n = int(input()) a = list(map(int, input().split())) pairs = [] used = [False for _ in range(n)] def dfs(): if len(pairs) == n // 2: ans = 0 for x in pairs: ans ^= x return ans else: for l in range(n): if used[l]: continue used[l] = True ans = 0 for r in range(l + 1, n): if used[r]: continue used[r] = True pairs.append(a[l] + a[r]) ans = max(ans, dfs()) pairs.pop() used[r] = False used[l] = False return ans print(dfs())