import Data.Char
import Data.List

decToBin :: Int -> String
decToBin 0 = "0"
decToBin 1 = "1"
decToBin n = decToBin (n`div`2) ++ show (n`mod`2)

chrToDig ch = if isDigit ch then ord ch - ord '0' else 0

delZero s = if elem 0 s then delZero (delete 0 s) else s

main=getContents>>=mapM_ putStrLn.map(unwords.(map show).delZero.zipWith(*)(iterate(*2)1).(reverse.map chrToDig).decToBin.read).lines