n = gets.to_s.to_i a = gets.to_s.split.map(&.to_i64) ans = a.max_of do |i| a.max_of do |j| i ^ j end end pp ans