let () = let rec convert n = if n < 2 then string_of_int n else if n mod 2 = 1 then "1" ^ convert (n/2) else "0" ^ convert (n/2) in Scanf.scanf "%d %d\n" @@ fun a c -> let a', c' = convert a, convert c in let str = ref "" in let len = max (String.length a' - 1) (String.length c' - 1) in let minlen = min (String.length a' - 1) (String.length c' - 1) in let maxstr = if (String.length a' - 1) > (String.length c' - 1) then a' else c' in for i = 0 to len do if i > minlen then str := !str ^ String.make 1 maxstr.[i] else if a'.[i] = c'.[i] then str := !str ^ "0" else str := !str ^ "1" done; let ans = ref 0. in for i = 0 to String.length !str - 1 do if !str.[i] = '1' then ans := !ans +. (2. ** float_of_int i) done; Printf.printf "%d\n" (int_of_float !ans)