main=do
    n<-readLn::IO Int
    putStrLn $ f2 n

f2 :: Int -> String
f2 n
    | n==0 = "0"
    | True = fe n []

fe n r
    | n==0 = r
    | odd n = fo ((n-1)`div`2) ('1':r)
    | True  = fo (n`div`2) ('0':r)

fo n r
    | n==0 = r
    | odd n = fe ((n+1)`div`2) ('1':r)
    | True  = fe (n`div`2) ('0':r)
