import sys sys.setrecursionlimit(10**9) N = int(input()) A = list(map(int, input().split())) def dfs(sets, p): ans = [] if not sets: return p m = min(sets) sets ^= {m} for i in sets: ans.append(dfs(sets^{i}, p ^ (A[m]+A[i]))) return max(ans) sets = set(range(N)) print(dfs(sets, 0))