Problem Statement
You are given a sequence of $N$ non-negative integers $A=(A_1,A_2,\dots,A_N)$. Consider performing the following operation $N-1$ times on this sequence to obtain a sequence of length $1$:
- Let
$n$be the length of$A$. First, rearrange the elements in$A$in any order you like. Then, replace$A$with a sequence of$n-1$non-negative integers$(A_1 \oplus A_2, A_2 \oplus A_3, \dots, A_{n-1} \oplus A_n)$.
Here, $\oplus$ represents the bitwise $\mathrm{XOR}$ operation.
Let $X$ be the value of the term contained in the sequence of length $1$ obtained after $N-1$ operations. Find the maximum possible value of $X$.
What is the bitwise $\mathrm{XOR}$ operation? The bitwise $\mathrm{XOR}$ of two non-negative integers $A$ and $B$, denoted as $A \oplus B$, is defined as follows: In the binary representation of $A \oplus B$, the digit at the $2^k$ ($k \geq 0$) position is $1$ if the digit at the $2^k$ position is $1$ in $A$ or $B$ but not both, and $0$ otherwise. For example, $3 \oplus 5 = 6$ (in binary: $011 \oplus 101 = 110$). In general, the bitwise $\mathrm{XOR}$ of $k$ non-negative integers $p_1, p_2, p_3, \dots, p_k$ is defined as $(\dots ((p_1 \oplus p_2) \oplus p_3) \oplus \dots \oplus p_k)$, and it can be proved that this does not depend on the order of $p_1, p_2, p_3, \dots, p_k$.
Constraints
$2 \leq N \leq 100$$0 \leq A_i < 2^{60}$- All input values are integers.
Input
The input is given from Standard Input in the following format:
N
A_1 A_2 \dots A_N
Output
Print the answer.
样例
4
1 2 3 4
7
13
451745518671773958 43800508384422957 153019271028231120 577708532586013562 133532134450358663 619750463276496276 615201966367277237 943395749975730789 813856754125382728 705285621476908966 912241698686715427 951219919930656543 124032597374298654
1152905479775702586
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。