N = gets.to_i
As = gets.split.map(&:to_i)

x = As.inject(:^)
a = As.map{|a| a &= ~x}
r = 0
59.downto(0).each do |i|
  while j = (r ... N).find{|v| a[v].to_s(2)[i] == '1'}
    a[r] ^= a[j] if j > r
    (r + 1 ... N).each{|j| a[j] ^= a[r] if a[j]^a[r] < a[j]}
    r += 1
  end
end
puts 2*a.inject(0){|m, v| m^v > m ? m^v : m} + x