Problem: You are given a tree consisting of nodes. You want to write some labels on the tree's edges such that the following conditions hold:
- Every label is an integer between and inclusive.
- All the written labels are distinct.
- The largest value among over all pairs of nodes is as small as possible.
Here, denotes the smallest non-negative integer that isn't written on any edge on the unique simple path from node to node .
Input Format: The first line contains the integer () — the number of nodes in the tree.
Each of the next lines contains two space-separated integers and () that mean there's an edge between nodes and . It's guaranteed that the given graph is a tree.
Output Format: Output integers. The of them will be the number written on the edge (in the input order).
Note: The tree from the second sample: