import sys sys.setrecursionlimit(10000) n=int(input()) a=list(map(int,input().split())) ans=[] def f(l,now): global ans if len(l)==2: now+=l[0]^l[1] ans.append(now) return for i in range(1,len(l)): f(l[1:i]+l[i+1:],now+l[0]^l[i]) f(a,0) print(max(ans))