import Control.Monad

main = do
    n <- read <$> getLine
    putStrLn $ if solve n == "" then "0" else solve n

solve :: Int -> String
solve 0 = ""
solve n = solve ((n - r) `div` (-2)) ++ show r
  where
    r = n `mod` 2