import Control.Applicative ((<$>), (<*>))
import Control.Monad
import Data.List

main :: IO ()
main = do
  getl solve >>= putStrLn

solve :: String -> String
solve xs = reverse $ foldl f "" xs
  where
    f ss c
      | c == '0' = '0' : ss
      | c == '1' = '1' : ss
      | otherwise = if null ss then "" else tail ss

getl :: (String -> a) -> IO a
getl f = f <$> getLine
