import           Text.Printf
import           Control.Monad         (replicateM)
import qualified Data.ByteString.Char8 as BSC8

main :: IO ()
main = do
    n <- readLn :: IO Int
    xs <- replicateM n (BSC8.unpack <$> BSC8.getLine)
    let (c0, c1, c2, c3) = solve xs (0, 0, 0, 0)
    printf "AC x %d\nWA x %d\nTLE x %d\nRE x %d\n" c0 c1 c2 c3
solve :: [String] -> (Int, Int, Int, Int) -> (Int, Int, Int, Int)
solve [] t = t
solve (x:xs) (a, b, c, d)
    | x == "AC"  = solve xs (a + 1, b, c, d)
    | x == "WA"  = solve xs (a, b + 1, c, d)
    | x == "TLE" = solve xs (a, b, c + 1, d)
    | x == "RE"  = solve xs (a, b, c, d + 1)
    | otherwise  = solve xs (a, b, c, d)