result :: Int -> [Int] -> [Int] -> [Int]
result 0 [] ans = ans
result 0 ws ans = ans
result w' [] ans = ans
result w' (w:ws) ans = if w' >= w
                         then result (w' - w) ws (w:ans)
                         else result w' ws ans

main = do
    input <-  getLine
    let ws = [512, 256, 128, 64, 32, 16, 8, 4, 2, 1]
    if input == ""
      then return ()
      else do
        let i = (read :: String -> Int) input
        putStrLn $ unwords $ map show (result i ws [])
        main