import Debug.Trace


solve :: Int -> Bool -> String
solve n False
    | n == 0 = []
    | mod n 2 == 0 = "0" ++ solve (div n 2) True
    | otherwise = "1" ++ solve (div (n-1) 2) True
solve n True
    | n == 0 = []
    | mod n 2 == 0 = "0" ++ solve (div n 2) False 
    | otherwise = "1" ++ solve (div (n+1) 2) False

main :: IO ()
main = do
    n <- read <$> getLine
    -- print n
    putStrLn $ if n == 0 then "0" else reverse (solve n False)
