let odd n = if n mod 2 = 0 then 0 else 1

let f n = (odd ((n + 1) / 2)) lxor (if (n + 1) mod 2 = 0 then 0 else n)

let f a b = f (a - 1) lxor f b

let _ =
  let a, b = Scanf.scanf "%d %d\n" (fun a b -> (a, b)) in
  f a b |> print_int