let rec pow x n =
  if n = 0 then 1
  else x * (pow x (n-1));;

let f x =
  let rec loop h = function
      10 -> h
    | i -> loop (x land (pow 2 i)::h) (i+1)
  in loop [] 0;;

let mk_str x y =
  if y>0 then
    ((string_of_int y)^(if x = "" then x else " "^x))
  else x;;

let rec read () =
  try let n = read_int () in
      List.fold_left mk_str "" (f n) |> print_endline;
      read ()
  with End_of_file -> ();;

let () = read();;