A telephone company wants to build a new telephone network in a city. The company aims for every person in the city to be able to call any other person. Of course, direct connections between every pair of people are not possible. Instead, the company uses a network made up of several layers.
We denote a network switch in layer by . A switch consists of one input, one output, and a cable connecting the input to the output. A switch with j > 0 consists of 2^j inputs, 2^j outputs, and two switches S(j-1). Input of (0 \leq i < 2^j) is connected via a cable to the inputs i \bmod 2^{j-1} of each of the two switches S(j-1). Similarly, output of is connected to the outputs i \bmod 2^{j-1} of each of the two switches S(j-1).

The connections between a switch and the two switches S(j-1) it consists of.
We are considering a network with one switch in the outermost layer. It can be shown that any input and output of switch has a unique connection path to any of the switches. Therefore, any input of can be connected to any output, and the connection path is uniquely determined by specifying through which switch the connection is established.
We number the switches belonging to from to 2^{n}-1. The -th switch is defined as follows. Write the number in binary as b_{n-1}b_{n-2}\ldots b_0. This defines a path from an input of to the -th switch using the following procedure: for each , b_j = 0 means the path continues at the first switch to which it is directly connected, and b_j = 1 means it continues at the second switch. Note that regardless of which input of is chosen, this path arrives at the same switch, which is assigned the number . See the figure below the sample data for more details on how the numbering works.
Sometimes multiple connections are needed at the same time. To avoid interference, each input and output of all switches (0 \leq j \leq n) can be used by at most one connection. Given a set of connection requests, can you find connection paths for each request such that the paths are disjoint?
The first line contains a positive integer (1 \leq t \leq 100): the number of test cases. After that, for each test case:
One line with two integers (1 \leq n \leq 16) and (1 \leq m \leq 2^n): the layer of the outermost switch and the number of connection requests.
lines, each containing two integers a_i and b_i (0 \leq a_i, b_i < 2^n). Each such line represents a connection request from input a_i of to output b_i of . The integers a_i are all distinct, and the integers b_i are also all distinct.
For each test case:
One line with integers s_1, \ldots, s_m, where s_i is the number of the switch through which the connection from input a_i to output b_i is established.
The connection paths must be disjoint. You may print any valid solution, and you may assume that there is at least one valid solution.
Hint

A possible connection scheme for the second sample case, with used cables shown in bold.
Note: Special judge problem; you may get Wrong Answer if your output is in the wrong format.
Example 1