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