You are given the start and finish times of a DFS (Depth-first search) traversal of the vertices that are available in a rooted tree. Your task is to restore the tree.
Input format
Note:
Output format
Print integers. The integer denotes the parent of the vertex or if it is the root of the tree.
Note: The vertices of the tree are numbered from 1 to .
Constraints
Note that the interval of a vertex is open-ended ( ).