import System.IO (isEOF)

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