main :: IO ()
main = do
    n <- readLn
    ss <- sequence $ replicate n getLine
    putStrLn $ "AC x " ++ (show $ count "AC" ss)
    putStrLn $ "WA x " ++ (show $ count "WA" ss)
    putStrLn $ "TLE x " ++ (show $ count "TLE" ss)
    putStrLn $ "RE x " ++ (show $ count "RE" ss)
        where 
            count _ [] = 0
            count y (x:xs) 
                | x == y = 1 + count y xs
                | otherwise = count y xs