You are given a rooted tree T of n nodes and a graph G of n nodes. Initially, the graph G has no edges. There are two types of queries:
Input:
Output:
For each query of the second type, print the answer in a seperate line.
5 11 1 1 2 2 1 4 2 6 1 4 3 12 1 2 2 5 2 5 2 2 3 3 2 3 3 1 1 3 2 1 5 4 7 2 2 3 1 3 4 8 2 2 7
Decrypted queries:
1 4 2 6
1 4 3 12
1 2 2 5
2 2 2
2 4 3
2 2 3
1 3 5 2
1 2 1 7
2 3 3
1 5 1 8
2 3 7