let () =
  Scanf.scanf "%d %d" @@ fun a b ->
  let a = a - 1 in
  Array.init 40 (fun i ->
    let d = 1 lsl i in
    let bc = b / (2 * d) * d + max 0 (b mod (2 * d) - d + 1) in
    let ac = a / (2 * d) * d + max 0 (a mod (2 * d) - d + 1) in
    ((bc - ac) mod 2) lsl i)
  |> Array.fold_left (+) 0
  |> Printf.printf "%d\n"

