You have a map which consists of N points,some pairs of them are connected with unidirectional thread(it means we can move only in the specified direction.Overall there are N-1 threads on the map.

We need to choose a point from the map so that we can get from the chosen point to any another point on the point .For that we may have to inverse some of thread direction.

Tell all the points in the map which requires minimum inversion of thread direction in the given map.

Suppose we select a point P in the map which requires Q inversion of threads in order to reach all the points in the map as given above .

So u need to find all the points for which the number of inversions Q is minimum .

Input :first line has N number of points

next N-1 lines follow U V where there is an edge from U to V

Output: Return all points with minimum inversions such that we can reach all other points

PS:Coding challenge has been finished on interviewbit.