import Data.List

main :: IO ()
main = do
    n <- readLn
    print $ solve n

solve :: Integer -> Integer
solve = foldr (\x y -> x + 10 * y) 0 . unfoldr go
    where
        go 0 = Nothing
        go n = let (q, r) = n `divMod` 2 in Just (r, -q)