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

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

xorA = abA.reduce{|ary1, ary2| ary1.zip(ary2).map{|x1, x2| x1 + x2}}.
  map{|sum| (sum % 2 == 1 ? 1 : 0)}

ans = xorA.join("").to_i(2)

print("#{ans}\n")
