-- Try AtCoder
-- author: Leonardone @ NEETSDKASU
 
 
 
main = putStrLn . solve "" =<< getLine
 
solve xs []       = reverse xs
solve [] ('B':ys) = solve [] ys
solve xs ('B':ys) = solve (tail xs) ys
solve xs (y  :ys) = solve (y:xs)    ys
    

