{-# LANGUAGE BangPatterns #-}

module Main where

import Control.Applicative
import Control.Monad

mod2 :: Int -> (Int, Int)
mod2 x
    | r == 0    = (q, r)
    | otherwise = (q + 1, r + 2)
  where
    (q, r) = x `divMod` (-2)

solve :: Int -> [Int]
solve 0 = [0]
solve a = iter [] a
  where
    iter !xs 0 = xs
    iter !xs n = let (q, r) = mod2 n
                 in iter (r:xs) q

main :: IO ()
main = do
    n <- readLn :: IO Int
    putStrLn . concatMap show $ solve n