Forever97 has two sequences of number. One of them consists of n positive integer numbers a1, a2, ..., an. And the other one consisted of m positive integer numbers b1, b2, …, bn. Now Forever97 needs to get the maximum value of bitwise xor of one integer from the sequence a and one integer from the sequences b.
The input contains several test cases.
The first line contains two integer numbers n and m (1≤n, m≤105).
The second line contains n integer numbers a1, a2, ..., an (1≤ai≤109).
The third line contains m integer numbers b1, b2, ..., bm (1≤bi≤109).
For each test case, you should output the maximum number Forever97 can get.
3 3 1 2 3 4 5 6
7