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

numbers = []
if B - A < 8
  numbers = (A..B)
else
  numbers.push(A)
  (1..3).each do |i|
    if (A + i) % 4 != 0
      numbers.push(A + i)
    else
      break
    end
  end
  numbers.push(B)
  (1..3).each do |i|
    if (B - i) % 4 != 3
      numbers.push(B - i)
    else
      break
    end
  end
end

puts numbers.inject(:^)