XMAX  XOR Maximization
Given a set of integers S = { a_{1}, a_{2}, a_{3}, ... a_{S} }, we define a function X on S as follows:
X( S ) = a_{1} ^ a_{2} ^ a_{3} ^ ... ^ a_{S}.
(^ stands for bitwise 'XOR' or 'exclusive or')
Given a set of N integers, compute the maximum of the Xfunction over all the subsets of the given starting set.
Input
The first line of input contains a single integer N, 1 <= N <= 10^{5}.
Each of the next N lines contain an integer a_{i}, 1 <= a_{i }<= 10^{18}.
Output
To the first line of output print the solution.
Example
Input:
3
1
2
4
Output:
7
hide comments
rraj001:
20170513 14:46:21
Use gaussian elimination..similar problem on codechef


free__bird:
20170104 08:37:37
very strict time_limit , but good question finally ac :) 

kicchu_pari_na:
20160814 19:10:05
may i get any critical case? 

[Mayank Pratap]:
20160608 10:57:07
My 287th problem :) 

Alex Abbas:
20160423 22:41:31
Stick to c++ guys because Input is not formatted properly. 

minhthai:
20160309 04:43:42
not easy at all :( 

Pratik S:
20150911 16:14:19
are single element subsets accepted? i.e what is the output for:


Nishant Gupta:
20150408 14:43:41
nice one :) my 450th on spoj :D 

Tejas Sudhir Niphadkar:
20141225 05:43:04
@cc, no it is 3. 

RUDRA:
20141216 13:54:06
I think test cases are weak.(I don't know why!!!)

Added by:  gustav 
Date:  20110126 
Time limit:  0.149s0.281s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  classical problem 