import Control.Monad

main = do
 n   <- read <$> getLine :: IO Int
 ans <- replicateM n getLine :: IO [String]
 putStrLn $ "AC x "++ show (length $ filter (=="AC") ans)
 putStrLn $ "WA x "++ show (length $ filter (=="WA") ans) 
 putStrLn $ "TLE x "++ show (length $ filter (=="TLE") ans) 
 putStr $ "RE x "++ show (length $ filter (=="RE") ans)  