{"raw_statement":[{"iden":"problem statement","content":"Given is a number sequence $A$ of length $N$.  \nLet us divide this sequence into one or more non-empty contiguous intervals.  \nThen, for each of these intervals, let us compute the bitwise $\\mathrm{OR}$ of the numbers in it.  \nFind the minimum possible value of the bitwise $\\mathrm{XOR}$ of the values obtained in this way.\nWhat is bitwise $\\mathrm{OR}$?The bitwise $\\mathrm{OR}$ of integers $A$ and $B$, $A\\ \\mathrm{OR}\\ B$, is defined as follows:\n\n*   When $A\\ \\mathrm{OR}\\ B$ is written in base two, the digit in the $2^k$'s place ($k \\geq 0$) is $1$ if at least one of $A$ and $B$ is $1$, and $0$ otherwise.\n\nFor example, we have $3\\ \\mathrm{OR}\\ 5 = 7$ (in base two: $011\\ \\mathrm{OR}\\ 101 = 111$).  \nGenerally, the bitwise $\\mathrm{OR}$ of $k$ integers $p_1, p_2, p_3, \\dots, p_k$ is defined as $(\\dots ((p_1\\ \\mathrm{OR}\\ p_2)\\ \\mathrm{OR}\\ p_3)\\ \\mathrm{OR}\\ \\dots\\ \\mathrm{OR}\\ p_k)$. We can prove that this value does not depend on the order of $p_1, p_2, p_3, \\dots p_k$.\n\nWhat is bitwise $\\mathrm{XOR}$?The bitwise $\\mathrm{XOR}$ of integers $A$ and $B$, $A\\ \\mathrm{XOR}\\ B$, is defined as follows:\n\n*   When $A\\ \\mathrm{XOR}\\ B$ is written in base two, the digit in the $2^k$'s place ($k \\geq 0$) is $1$ if exactly one of $A$ and $B$ is $1$, and $0$ otherwise.\n\nFor example, we have $3\\ \\mathrm{XOR}\\ 5 = 6$ (in base two: $011\\ \\mathrm{XOR}\\ 101 = 110$).  \nGenerally, the bitwise $\\mathrm{XOR}$ of $k$ integers $p_1, p_2, p_3, \\dots, p_k$ is defined as $(\\dots ((p_1\\ \\mathrm{XOR}\\ p_2)\\ \\mathrm{XOR}\\ p_3)\\ \\mathrm{XOR}\\ \\dots\\ \\mathrm{XOR}\\ p_k)$. We can prove that this value does not depend on the order of $p_1, p_2, p_3, \\dots p_k$."},{"iden":"constraints","content":"*   $1 \\le N \\le 20$\n*   $0 \\le A_i \\lt 2^{30}$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $A_3$ $\\dots$ $A_N$"},{"iden":"sample input 1","content":"3\n1 5 7"},{"iden":"sample output 1","content":"2\n\nIf we divide $[1, 5, 7]$ into $[1, 5]$ and $[7]$, their bitwise $\\mathrm{OR}$s are $5$ and $7$, whose $\\mathrm{XOR}$ is $2$.  \nIt is impossible to get a smaller result, so we print $2$."},{"iden":"sample input 2","content":"3\n10 10 10"},{"iden":"sample output 2","content":"0\n\nWe should divide this sequence into $[10]$ and $[10, 10]$."},{"iden":"sample input 3","content":"4\n1 3 3 1"},{"iden":"sample output 3","content":"0\n\nWe should divide this sequence into $[1, 3]$ and $[3, 1]$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}