The integer is the number of vertices of both and ().
The following lines describe the edges of . For each , the integers and () mean that the -th edge connects vertices and . It is guaranteed that is a tree.
The next lines describe the edges of . For each , the integers and () mean that the -th edge connects vertices and . It is guaranteed that is a tree.
输出格式
Output lines. For each , the -th line should contain an integer satisfying the condition in the problem statement for the -th edge of .
If there are multiple possible answers, you may output any of them.
样例
样例输入 1
4
1 3
2 4
3 4
1 2
2 3
2 4
样例输出 1
1
3
2
数据范围与提示
In the first line of the sample output, is chosen for . Exchanging the edge of with the edge of leaves both and as trees.
For , both the edge of and the selected edge of are both , so exchanging them does not change either tree. Other valid outputs are also possible.