from itertools import combinations, permutations N = input() A = sorted(map(int, raw_input().split())) ans = 0 for c in combinations(range(N), N/2): X = [] Y = [] for i in xrange(N): if i in c: X.append(A[i]) else: Y.append(A[i]) for p in permutations(X): tmp = 0 for i in xrange(N/2): tmp ^= X[i] + Y[i] ans = max(ans, tmp) print ans