Graf has a graph, a graph with vertices and bidirectional edges. In this graph, Graf wonders: for each vertex how many vertices are within distance of it?
Input Specification
The first line will have space-separated , , and .
The next lines will describe the edges: there is an edge between every pair of integers on the next lines. Edges will not be repeated in the input.
of the test data will additionally have .
Output Specification
Output lines, the answer for vertex number on line .
Sample Input 1
6 7 1
1 2
2 3
1 4
2 5
4 6
3 4
2 6
Sample Output 1
3
5
3
4
2
3
Sample Input 2
4 6 1
1 2
1 3
1 4
2 3
2 4
3 4
Sample Output 2
4
4
4
4
Comments
Is this question solvable in python?