Maximum XOR (Easy)
Vasylko has N non-negative integers: a_1, a_2, ..., a_N. Tired of the usual bitwise operations AND and OR, he and his friend Vitaliy decided to try something new.
Vasylko asked Vitaliy, the programmer, to compute the XOR sum for every possible non-empty subsequence of these N numbers. From the resulting 2^N-1 numbers, they aimed to find the maximum.
Vasylko, being a skilled mathematician, is confident that they should have identified the maximum XOR sum, given that all possible subsequences were considered. However, he is aware that Vitaliy might have made an error (as programmers sometimes do, whether by choosing the wrong data type, initializing a variable incorrectly, or implementing the algorithm improperly). Additionally, Vasylko intended for N to be quite large, which caused Vitaliy's program to run excessively long when N was 25 or more. To ensure that Vasylko can be certain they have found the maximum XOR sum (and to prevent Vitaliy from wasting computational resources on large N), your task is to help calculate the maximum XOR sum.
Input
The first line contains the integer N, where 1 ≤ N ≤ 50. The second line contains N integers, each 0 ≤ a_i ≤ 10^6.
Output
Output a single integer, which is the maximum XOR sum.