N = int(input()) A = list(map(int, input().split())) def dfs(mask, current_xor): if mask == (1 << N) - 1: return current_xor # Find the first unused player i = 0 while i < N and (mask & (1 << i)): i += 1 max_val = 0 for j in range(i + 1, N): if not (mask & (1 << j)): new_mask = mask | (1 << i) | (1 << j) s = A[i] + A[j] res = dfs(new_mask, current_xor ^ s) if res > max_val: max_val = res return max_val print(dfs(0, 0))