n=gets.to_i xs=gets.split(" ").map{|e| e.to_i} ans=0 n.times{|i| n.times{|j| next if i==j ans=[ans,xs[i]^xs[j]].max } } puts ans