module Main where
import Control.Monad

myPrint :: [String] -> String -> String
myPrint s p = unwords [p, "x", show $ sum [1 | x<-s, x==p]]

main :: IO ()
main = do
    n <- readLn
    s <- replicateM n getLine
    putStrLn $ myPrint s "AC"
    putStrLn $ myPrint s "WA"
    putStrLn $ myPrint s "TLE"
    putStrLn $ myPrint s "RE"