main = getLine >>= putStrLn . reverse . solve []

solve ts [] = ts
solve ts ('0':ss) = solve ('0':ts) ss
solve ts ('1':ss) = solve ('1':ts) ss
solve [] ('B':ss) = solve [] ss
solve (_:ts) ('B':ss) = solve ts ss