readInt :: String -> Integer
readInt = read

main = do
    s <- readInt <$> getLine
    print.reverse $ solve [1,s]

solve :: [Integer] -> [Int]
solve [i,a] = 
        if a == 0 then []
           else (if (mod a 2^i) == 0 
                   then [0] ++ solve [i+1,a]
                   else [1] ++ solve [i+1,a - ((-2)^(i-1))])