There is a walkway that is famous as a hiking course. Its entrance is the westmost point of the walkway. The walkway is a simple path made only of horizontal runs and vertical runs, so at every corner it turns 90 degrees, either left or right. Walking from the entrance toward the exit, you never move from east to west, which means you reach the exit without the x coordinate of your position ever getting smaller. That is why the walkway is called a monotone walkway. Figure 1 shows an example of a monotone walkway.

Figure 1. An example of a monotone walkway
There are n cafes along the walkway. The entrance, the exit and every corner all have a cafe. Kim, who manages the course, has the coordinates of every cafe on the walkway. The entrance is always at the origin (0,0). Kim wants to number the cafes from 1 to n. The cafe at the entrance gets number 1, and the rest get their numbers in the order you meet them while following the walkway. If you meet cafe A before cafe B on the way from the entrance to the exit, then A gets a smaller number than B. So on the walkway of figure 1, the cafe at (3,1) is number 5, the cafe at (9,0) is number 14, and the cafe at the exit is number 17. Kim wants to finish this job from the coordinates alone, without walking the course. Help Kim and write a program that numbers the cafes.
Input is given on standard input. The first line holds the number of test data T (1≤T≤10). The first line of each test datum holds an integer n (2≤n≤100,000), the number of cafes. Each of the next n lines holds two integers x and y, the coordinates of one cafe (0≤x≤100,000, −100,000≤y≤100,000). The coordinates come in arbitrary order, unrelated to the order of the walk. The entrance is always at (0,0), and no two cafes share the same coordinates. The last line holds an integer m (1≤m≤10) and m integers. Each of the m integers is a cafe number between 1 and n.
Print to standard output. For each test datum, print the answer for the m given cafe numbers in the given order, one per line. The answer for the number k is the pair of integers x and y, the coordinates of the cafe numbered k, separated by one space.