
open System

let a = stdin.ReadLine() |> int
let b = []
let list  = [|0; 0; 0; 0|]

for i=1 to a do
    let b = stdin.ReadLine()
    match b with
    | "AC" -> (list.[0] <- list.[0] + 1)
    | "WA" -> (list.[1] <- list.[1] + 1)
    | "TLE" -> (list.[2] <- list.[2] + 1)
    | "RE" -> (list.[3] <- list.[3] + 1)

for i=1 to 4 do
    match i with
    | 1 -> list.[i-1] |> printf "AC x %d\n"
    | 2 -> list.[i-1] |> printf "WA x %d\n"
    | 3 -> list.[i-1] |> printf "TLE x %d\n"
    | 4 -> list.[i-1] |> printf "RE x %d\n"

