A, B = gets.split.map(&:to_i)

abA = A.upto(B).map{|x| x.to_s(2).split('')}
abA.map!{|ary| ary.map{|s| (s == "1" ? true : false)}}
len = abA[-1].length
abA.map! do |ary|
  if ary.length < len
    [false] * (len - ary.length) + ary
  else
    ary
  end
end

xor = abA.reduce do |ary1, ary2|
  new_ary = []
  ary1.each_with_index do |tf, i|
    new_ary.push tf ^ ary2[i]
  end
  new_ary
end

ans = xor.map{|tr| (tr ? "1" : "0")}.join("").to_i(2)

print("#{ans}\n")
