import Control.Applicative

getInt :: IO Int
getInt = (\a -> read a :: Int) <$> getLine

getInteger :: IO Integer
getInteger = (\a -> read a :: Integer) <$> getLine

changeStr :: String -> String -> String
changeStr "" res = res
changeStr ('1':input) res = changeStr input $ '1' : res
changeStr ('0':input) res = changeStr input $ '0' : res
changeStr ('B':input) "" = changeStr input ""
changeStr ('B':input) (_:res) = changeStr input res

main = do
    putStrLn =<< (changeStr <$> getLine <*> (return "" :: IO String))
