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' && (dropWhile (\y -> y == 'B') xs)==[] = []
        |otherwise = f ((takeWhile (\y -> y == 'B') xs) ++ (tail (dropWhile (\y -> y == 'B') xs)))
                 |