let N = stdin.ReadLine() |> int
let S =
    [|1..N|]
    |> Array.map (fun _ -> stdin.ReadLine())

S
|> Array.scan (fun (ac,wa,tle,re) item ->
    match item with
    | "AC" -> (ac+1,wa,tle,re)
    | "WA" -> (ac,wa+1,tle,re)
    | "RE" -> (ac,wa,tle,re+1)
    | "TLE" -> (ac,wa,tle+1,re)) (0,0,0,0)
|> ((fun x -> x.[N]) >> (fun (ac,wa,tle,re) -> printfn "AC x %d\nWA x %d\nTLE x %d\nRE x %d" ac wa tle re))