#abc281f. [abc281_f]Xor Minimization
[abc281_f]Xor Minimization
Problem Statement
You are given a sequence of non-negative integers .
Let us perform the following operation on just once.
- Choose a non-negative integer . Then, for every , replace the value of with the bitwise XOR of and .
Let be the maximum value in after the operation. Find the minimum possible value of .
What is bitwise XOR? The bitwise XOR of non-negative integers and , , is defined as follows.
- When is written in binary, the -th lowest bit () is if exactly one of the -th lowest bits of and is , and otherwise.
For instance, (in binary: ).
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3
12 18 11
Sample Output 1
16
If we do the operation with , the sequence becomes $(12 \\oplus 2,18 \\oplus 2, 11 \\oplus 2) = (14,16,9)$, where the maximum value is .
We cannot make smaller than , so this value is the answer.
Sample Input 2
10
0 0 0 0 0 0 0 0 0 0
Sample Output 2
0
Sample Input 3
5
324097321 555675086 304655177 991244276 9980291
Sample Output 3
805306368