import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N, *A = map(int, read().split()) def gen_powers(A): if not A: yield 0 return n = len(A) for i in range(1,n): B = A[1:i] + A[i+1:] yield (A[0] ^ A[i]) + max(gen_powers(B)) answer = max(gen_powers(A)) print(answer)