main :: IO ()
main = do 
        n <- getLine
        putStrLn $ filterLine n

filterLine :: String -> String
filterLine (x:[]) = if x /= 'B' then [x] else ""
filterLine (x:xs) = if head xs /= 'B' && x /= 'B' 
                    then x : filterLine xs 
                    else filterLine xs