import Control.Monad
import Data.List
main = do
    n <- readLn
    ds <- replicateM n getLine
    putStrLn $ "AC x " ++ (show $ length $ filter (=="AC") ds)
    putStrLn $ "WA x " ++ (show $ length $ filter (=="WA") ds)
    putStrLn $ "TLE x " ++ (show $ length $ filter (=="TLE") ds)
    putStrLn $ "RE x " ++ (show $ length $ filter (=="RE") ds)
