main = interact $ unlines . map (unwords . map show . weight . (read::String->Int)) . lines
weight w = count w [512,256,128,64,32,16,8,4,2,1] []
 where
  count 0 _ acc = acc
  count _ [] _ = []
  count w' (x:xs) acc = count (w'-x) xs (x:acc) ++ count w' xs acc