Edge Weight Assignment
시간 제한1초메모리 제한1024 MB
트리의 각 간선에 양의 정수를 부여해 모든 잎 사이 경로의 XOR이 0이 되게 하고, 사용한 서로 다른 가중치 개수의 최솟값과 최댓값을 구한다.
문제
You have unweighted tree of vertices. You have to assign a positive weight to each edge so that the following condition would hold:
- For every two different leaves and of this tree, bitwise XOR of weights of all edges on the simple path between and has to be equal to .
Note that you can put very large positive integers (like ).
It's guaranteed that such assignment always exists under given constraints. Now let's define as the number of distinct weights in assignment.

In this example, assignment is valid, because bitwise XOR of all edge weights between every pair of leaves is . value is here, because there are distinct edge weights( and ).

In this example, assignment is invalid, because bitwise XOR of all edge weights between vertex and vertex () is not .
What are the minimum and the maximum possible values of for the given tree? Find and print both.
입력
The first line contains integer () --- the number of vertices in given tree.
The -th of the next lines contains two integers and () --- it means there is an edge between and . It is guaranteed that given graph forms tree of vertices.
출력
Print two integers --- the minimum and maximum possible value of can be made from valid assignment of given tree. Note that it's always possible to make an assignment under given constraints.
힌트
In the first example, possible assignments for each minimum and maximum are described in picture below. Of course, there are multiple possible assignments for each minimum and maximum.

In the second example, possible assignments for each minimum and maximum are described in picture below. The value of valid assignment of this tree is always .

In the third example, possible assignments for each minimum and maximum are described in picture below. Of course, there are multiple possible assignments for each minimum and maximum.
