Oops, there is something wrong with the Pandaemonium. The friend of Azem, Themis, is just waiting for you to have a look together.
Oh no, rattled Erichthonios, who is the guard of Pandaemonium, misunderstanding you as enemies, starts attacking you. Can you protect yourself and Themis until he calms down?
To simplify the problem, Themis' defending system have nn blocks in a line. All the blocks have a initial weight 0 and the same attribute. Erichthonios will perform following 4 kinds of attack qqtimes:
Attention: Since you don't know what Erichthonios will do next, there is encoding with the queries. (See the \bf{input}input)
If you couldn't solve this problem, you will be laughed at by Hythlodaeus later. You don't want to be like that, right?
Each test contains multiple test cases. The first line contains the number of test cases(1≤T≤20). Desc
The first line contains two integers nn and qq (3≤n≤108, 1≤q≤105) -- The number of Themis defending system blocks, and the number of attacks that Erichthonios will perform.
The following qq lines contains Erichthonios' attacks, (initially, last = 0last=0):
Where ⊕ means bitwise XOR operation, \text{and}and means bitwise AND operation.
It is guaranteed that the sum of n does not exceed 2⋅109 and the sum of q does not exceed 106
For each test case:
For each 4-th attack, print one integer in a line --- the weight of the block.
1
16 12
3 10 16
4 2
1 1 6
1 5 6
1 9 7
1 15 7
2 2 10
2 2 13
3 1 16
4 16
4 9
4 4
16
32
32
16
The decoded attacks in example:
3, x = 10 , v = 16
4, x = 2
1, x = 1 , c = 1
1, x = 5 , c = 1
1, x = 9 , c = 2
1, x = 15 , c = 2
2, x = 2 , y = 10
2, x = 2 , y = 13
3, x = 1 , v = 16
4, x = 16
4, x = 9
4, x = 4