main :: IO ()
main = do
    array <- readLn >>= input
    putStrLn $ (++) "AC x " $ show (count "AC" array)
    putStrLn $ (++) "WA x " $ show (count "WA" array)
    putStrLn $ (++) "TLE x " $ show (count "TLE" array)
    putStrLn $ (++) "RE x " $ show (count "RE" array)

input :: Int -> IO [String]
input 0 = pure [] :: IO [String]
input n = (:) <$> getLine <*> input (n-1)

count :: (Ord a) => a -> [a] -> Int
count _ [] = 0
count n (x:xs)
    | n == x    = 1 + count n xs
    | otherwise = count n xs 
