XOR Sum 2

Pick any subsequence of up to 100,000 numbers under 10^18 so that the XOR of the chosen elements is maximum.

Hard8Bit manipulationGreedyMathNo attempts yetTime limit2sMemory limit512 MB

Problem

You are given a sequence AA of NN numbers.

You want to choose a subsequence of AA. The XOR sum of a subsequence is the value obtained by XORing all of its elements together.

Given the sequence AA, write a program that finds the subsequence with the largest XOR sum.

Input

The first line contains the length of the sequence NN (1N100,0001 \le N \le 100{,}000). The second line contains the NN numbers of the sequence AA. Each number in AA is a positive integer less than or equal to 101810^{18}.

Output

Print the XOR sum of the subsequence of AA whose XOR sum is the largest.