let n = stdin.ReadLine() |> int
let sArr = 
    [| for _ in 1..n -> stdin.ReadLine() |]

let ansS = sArr |> Array.countBy id

[| "AC"; "WA"; "TLE"; "RE"; |] 
|> Array.iter (fun label ->
    ansS |> Array.tryFind (fun (s, _) -> s = label) 
    |> Option.defaultValue (label, 0) 
    |> fun (str, cnt) -> str + " x " + string cnt 
    |> stdout.WriteLine )