let f a =
  Array.fold_left ( lor ) 0 @@ Array.init 48 @@ function
    | 0 -> (a + 1) lsr 1 land 1
    | i -> (max 0 (a land ((1 lsl (i + 1)) - 1) - (1 lsl i) + 1) land 1) lsl i

let () = Scanf.scanf "%d %d" @@ fun a b ->
  Printf.printf "%d\n" @@ f a lxor f b lxor a

