{-# LANGUAGE OverloadedStrings #-}
import Control.Applicative
import qualified Data.Text as T

solve s =
  if s == s' then s else solve s
  where s' = T.replace "ST" "" s

main = do
  s <- T.pack <$> getLine :: IO T.Text
  print $ solve s
