main = do
	n <- readLn :: IO Int
	dat <- fmap words . lines <$> getContents
	let flatten = foldr (\ a b -> a++b) []
	let count str = foldr (\b a -> if b == str then a+1 else a ) 0 (flatten dat)
	mapM (\str ->  putStrLn $ str ++ " x " ++ (show $ count str)) ["AC", "WA", "TLE", "RE"]