main = do
 s<- getLine
 putStrLn $ reverse $ f $ reverse s
f []= []
f (x:xs)
        |x=='0' ="0" ++ (f xs)
        |x=='1' ="1" ++ (f xs)
        |x=='B' = f ((takeWhile \y->y=='B' xs) ++ (tail (dropWhile \y->y=='B' xs)))
