In this problem, you are given $n$ integers $a_1, a_2, \dots, a_n$. You want to perform exactly $n-1$ operations.
- Choose two integers $x$ and $y$ from the sequence, remove them, and add the integer $x \oplus y$ to the sequence.
- "$\oplus$" is the bitwise XOR operator. For example, $3 \oplus 5 = 6$, $15 \oplus 28 = 19$.
Performing only this operation is a bit boring, so at any time you can choose one integer from the sequence and add $1$ to it. You must perform this "add one" operation exactly once. Finally, the sequence will contain only one integer, and you want to maximize this remaining integer. Output the maximum possible value of this remaining integer.
Input
The first line contains an integer $n$ ($1 \le n \le 10^6$). The next line contains $n$ integers $a_1, a_2, \dots, a_n$ ($0 \le a_i < 2^{60}$).
Output
Output a single integer representing the maximum possible remaining value.
Examples
Input 1
4 1 2 1 2
Output 1
7
Input 2
5 1 2 3 4 5
Output 2
14
Input 3
6 1 2 4 7 15 31
Output 3
47
Note
In the first example, an optimal strategy is as follows:
- Choose $1$ and $2$: $[1, 2, 1, 2] \to [1, 2, 3]$
- Choose $1$ and $2$: $[1, 2, 3] \to [3, 3]$
- Add $1$ to $3$: $[3, 3] \to [3, 4]$
- Choose $3$ and $4$: $[3, 4] \to [7]$