--
backSpaced :: String -> String
backSpaced ""         = ""
backSpaced (  'B':xs) = backSpaced xs
backSpaced (_:'B':xs) = backSpaced xs
backSpaced (x:xs) = x: backSpaced xs

--
main :: IO ()
main = do
    l <- getLine
    putStrLn $ backSpaced l