let () = Scanf.scanf "%d"
           (fun n ->
             let rec minus2ary_from_10ary quotient ans_l =
               match quotient with
               | 0 -> if ans_l = [] then [0] else ans_l
               | n when n > 0 -> minus2ary_from_10ary (n / -2) ((n mod -2) :: ans_l)
               | n when n mod -2 == 0 -> minus2ary_from_10ary (n / -2) (0 :: ans_l)
               | n ->  minus2ary_from_10ary (n / -2 + 1) (1 :: ans_l)  (* 結果の調整 *)
             in
             let rec print_int_from_l l  =
               match l with
               | [] -> print_string ""
               | x :: xs -> print_int x; print_int_from_l xs
             in
             print_int_from_l (minus2ary_from_10ary (n) []))

