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|
  if j = (r ... N).find{|k| (a[k] >> i) & 1 == 1}
    a[r], a[j] = a[j], a[r]
    N.times do |j|
      next if j == r
      a[j] ^= a[r] if (a[j] >> i) & 1 == 1
    end
    r += 1
  end
end
puts 2*a[0, r].inject(:^) + x