Implement a persistent queue.
The first line contains the number of operations (1 \leq n \leq 200000). The (i+1)-th line contains the description of the -th operation:
— add the number to the end of queue number (0 \leq t < i);
— remove the first element from queue number (0 \leq t < i).
As a result of the -th operation, described in the (i+1)-th line, a new queue numbered is created. Initially, there is an empty queue numbered zero.
All numbers in the input are -bit signed integers.
For each remove operation, output the removed element on a separate line.
Example 1