Find the centroid
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Find any centroid in the tree.
Input
The first line contains one integer , representing the number of vertices. Each of the following lines contains two integers and , representing vertices connected by an edge.
It is guaranteed that the graph is a tree.
Output
Print the number of a vertex that is a centroid. If there are multiple centroids, print any one of them.
Examples
Input #1
Answer #1
Submissions 56
Acceptance rate 30%