A,B = gets.split.map(&:to_i)
bits = []
bit_length = (A+B).to_s(2).length
(A..B).each do |num|
  bits << num.to_s(2).rjust(bit_length, "0").chars
end

ans = ""
bits.transpose.each do |bit|
  bit_count = bit.count{|b| b == "1"}
  if bit_count.even?
    ans << "0"
  else
    ans << "1"
  end
end

puts ans.to_i(2)