In Olympic tournaments, ski slopes and facilities are often the most remote and widely spread out. The Vancouver Olympics followed this pattern. However, the organizers ensured that all ski facilities and the Olympic village were connected by a network of roads. Due to their arrangement, there is only one route between any two facilities (or between a facility and the Olympic village), which may pass through other facilities.
Each facility is numbered from to , with the Olympic village designated as number . At each facility, there is a sign displaying either <<\textbf{>X}>> or <<\textbf{X}>>, indicating that <<\textbf{On the way from this facility to the Olympic village, you will pass through more than X other ski facilities}>>.
One evening, after visiting a local bar, two tourists debated whether it is possible to reconstruct the map of roads between the ski facilities using the information from these signs. Your task is to settle their argument.
The first line contains the number (2 \leq N \leq 50000). The next N-1 lines each contain a distance characteristic for the corresponding facility, starting with facility .
0 \leq X \leq 100000. Note that there is no <<\textbf{<0}>> in the input data.
You must output N-1 lines describing the roads between the facilities. Each line should contain two numbers from to , separated by a space, representing the facilities connected by a road. If there are multiple valid solutions, you may output any one of them. If no solution is possible, output .
Example 1