Scanf.scanf "%d" (fun n ->
    let a = Array.init n (fun _ -> Scanf.scanf " %d" (fun a -> a)) in

    let rec loop i acc =
        if i = n then acc else
            loop (i + 2) (acc lxor a.(i) lxor a.(i + 1))
    in
    let all = loop 0 0 in
    Array.iter (fun v -> Printf.printf "%d " (v lxor all)) a;
    print_newline ()
)