solve com = h com []
            where h [] res = reverse res
                  h ('B':cs) res = case res of
                                     [] -> h cs []
                                     (r:es) -> h cs es
                  h ('1':cs) res = case res of
                                     [] -> h cs "1"
                                     otherwise -> h cs ('1':res)
                  h ('0':cs) res = case res of
                                     [] -> h cs "0"
                                     otherwise -> h cs ('0':res)

main = do com <- getLine
          putStrLn $ solve com
