let weight n = 
  let rec iter = function
    | [] -> []
    | hd :: tl when n land hd = 0 -> iter tl
    | hd :: tl -> hd :: iter tl
  in iter [1;2;4;8;16;32;64;128;256;512]

let rec join s = function
  | [] -> ""
  | [x] -> string_of_int x
  | hd :: tl -> string_of_int hd ^ s ^ join s tl

let _ = 
  try 
    while true do
      let n = read_int () in
      let lst = weight n in
      print_endline (join " " lst)
    done
  with
    End_of_file -> ()