Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

EIMAXHTR - The highest tree

Given a tree N vertices, numbered from 0-to N-1. Find the vertex with the smallest index such that the height of the tree is greatest if the vertex  with the smallest is root

Input

The first line is an integer N (1 <= N <= 10 ^ 5).

The next N - 1 lines contain 2 integers u v, the connecting edge between vertex u and vertex v.

Output

Print the vertex and maximum height

Example

Input:
3
0 1
1 2

Output:
0 2
Input:
4
0 1
0 2
2 3

Output:
1 3

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.