import Control.Applicative

solve xs [] = xs
solve xs ('0':s) = solve (xs ++ "0") s
solve xs ('1':s) = solve (xs ++ "1") s
solve xs ('B':s)
	| xs /= "" = solve (init xs) s
	| otherwise = solve xs s

main :: IO()
main = do
	s <- getLine
	putStrLn $ solve "" s