import Control.Monad.Trans.State

main :: IO ()
main = do
  n <- readLn
  putStrLn $ evalState solve (n, [])

solve :: State (Int, String) String
solve = do
  (n, s) <- get
  case (n, s) of
    (0, "")    -> return "0"
    (0, s)     -> return s
    (n, s)
      | odd n  -> put (-n `div` 2, '1' : s) >> solve
      | even n -> put (-n `div` 2, '0' : s) >> solve