import           Control.Monad

main :: IO ()
main = do
  n <- readLn
  s <- replicateM n getLine
  forM_ ["AC", "WA", "TLE", "RE"] (\r ->
    putStrLn $ r ++ " x " ++ show (length $ filter (== r) s))
