open System
let R T = stdin.ReadLine()|> T
let RS T = stdin.ReadLine().Split()|>Array.map T
let R2 T U = RS string|>fun c-> (c.[0]|>T),(c.[1]|>U)
let R3 T U V = RS string|>fun c-> (c.[0]|>T),(c.[1]|>U),(c.[2]|>V)
let R4 T U V W = RS string|>fun c-> (c.[0]|>T),(c.[1]|>U),(c.[2]|>V),(c.[3]|>W)
let R5 T U V W X = RS string|>fun c-> (c.[0]|>T),(c.[1]|>U),(c.[2]|>V),(c.[3]|>W),(c.[4]|>X)
[<EntryPoint>]
let main argv =
    let N=R int
    let cnt arr str = 
        arr
        |>Seq.sumBy(fun c-> if c=str then 1 else 0)
    let S=[|for i in [1..N] do yield (R string)|]
    printfn "AC x %d" (cnt S "AC")
    printfn "WA x %d" (cnt S "WA")
    printfn "TLE x %d" (cnt S "TLE")
    printfn "RE x %d" (cnt S "RE")
    0