import Control.Applicative
import Control.Monad
import Data.List

f :: String -> Char -> String
f xs '0' = '0' : xs
f xs '1' = '1' : xs
f xs 'B' = drop 1 xs

main :: IO ()
main = do
    ss <- getLine
    putStrLn $ reverse $ foldl' f "" ss