Power#8250

Power

1 second
64 megabytes
Medium

Barik has devised a problem for you, but decided that having **2** easy problems in a contest is excessive. Therefore, he offers you the following challenge. You are given an array consisting of numbers. Your task is to determine the maximum value of the function

f(l_1, r_1, l_2, r_2) = (a_{l_1} \oplus a_{l_1 + 1} \oplus \cdots \oplus a_{r_1}) + (a_{l_2} \oplus a_{l_2 + 1} \oplus \cdots \oplus a_{r_2})

subject to the condition l_1 \leq r_1 < l_2 \leq r_2.

Here, denotes the bitwise XOR operation.

Input

The first line contains a single integer (2 \leq N \leq 2 \times 10^5) — the size of the array .

The second line contains integers a_1, a_2, \ldots, a_N (1 \leq a_i \leq 10^9) — the elements of the array .

Output

Print a single integer — the maximum value of .

Examples

Example 1

Loading
Loading