def f(res,i)
  return res ^ i
end

A,B = readline.chomp.split.map(&:to_i)
res = A

# result = (B - A) % 2 == 0 ? f(1,B) : f(A,B)
# p result

(A+1..B).each do |i|
  res = f(res,i)
end

j = 0
ary = []
for i in (A..B)
  ary.push(i ^ (i+1)) if (j % 2 == 0)
  # p ary
  j += 1
end

p res