
main :: IO ()
main = readLn >>= putStrLn . solve 

-- | 
-- >>> solve (-9)
-- "1011"
-- >>> solve 123456789
-- "11000101011001101110100010101"
-- >>> solve 0
-- "0"
solve :: Int -> String
solve 0 = "0"
solve x = walk [] x
    where
        walk acc n
            | n == 0 = acc
            | m == -1 = walk ('1' : acc) $ r + 1
            | otherwise = walk ((head $ show m) : acc) r
            where
                (r, m) = n `divMod` (-2)