K. Choose
time limit per test
3 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

scutkk hasn't done any exercises for a long time. To test his current level, heiyubai decided to give him a problem.

heiyubai provided scutkk with two arrays $$$a$$$ and $$$b$$$ of length $$$n$$$. He required that for all $$$1 \le i \le n$$$, scutkk must choose exactly one number from $$$a_i$$$ and $$$b_i$$$, such that the XOR sum of all the numbers he chooses is maximized.

Since scutkk can't solve it, he asks you to help him solve this problem.

Input

The first line contains a single integer $$$n$$$ $$$(1 \le n \le 10^6)$$$ - the length of the array.

The second line contains n integer $$$a_1, a_2,...,a_n$$$ $$$(0 \le a_i \lt 2^{63})$$$

The third line contains n integer $$$b_1, b_2,...,b_n$$$ $$$(0 \le b_i \lt 2^{63})$$$

Output

Print the Maximum XOR sum of the number that you choose between $$$a_i$$$ and $$$b_i$$$ for all $$$1 \le i \le n$$$

Example
Input
2
2 3
1 1
Output
3