J. Two Faced Hobz
time limit per test
6 seconds
memory limit per test
256 megabytes
input
salkan.in
output
standard output

"There's no difference" said Hanz.

As we all know, Hobz is a hundred-faced person. Damn, With all these hundered-faced people I miss two-faced people.

However, thank god today we will only be dealing with $$$N$$$ two-faced copies of Hobz. The $$$i-th$$$ Hobz has value $$$A_i$$$ on the first face and value $$$B_i$$$ on the second face.

Now let's calculate their Salkan. Salkan is the Xor of values on their faces.

Now Hobz has a plan to deceive us. Because we all know he has $$$0$$$ Salkan. He will choose which face each of his copies will show so that their Salkan is maximum.

However, Hanz knows about Hobz's plan. So he decided to place a parameter $$$K$$$.

If Hobz's copies output Salkan $$$ \gt K$$$ Hanz will be sure that Hobz is playing them. Then Hobz's Salkan Becomes $$$0$$$.

Do you know what value Hobz will print if he wants his Salkan to be maximum?

Input

The first line contains the number of test cases $$$T$$$ $$$(1 \leq T \leq 10)$$$.

The first line of each test case contains two integers $$$N$$$ and $$$K$$$ $$$(1 \leq N \leq 10^5) (0 \leq K \lt 2^{30})$$$.

The second line of each test case contains $$$N$$$ space-separated integers $$$A_{1},A_{2},\dots,A_{N}$$$ $$$(0 \leq A_i \lt 2^{30})$$$.

The third line of each test case contains $$$N$$$ space-separated integers $$$B_{1},B_{2},\dots,B_{N}$$$ $$$(0 \leq B_i \lt 2^{30})$$$.

Output

For each test case, print Hobz's Salkan.

Example
Input
2
5 10
1 4 3 4 5
4 2 4 4 4
2 11
12 13
12 13
Output
7
1