open Batteries
let n = read_int ()
let dp = Array.init 4 @@ fun _ -> 0
let rec loop i = 
  if i >= n then () else (
    Scanf.sscanf (read_line()) "%s" (fun a -> 
      if a = "AC" then dp.(0) <- dp.(0) + 1 else
      if a = "WA" then dp.(1) <- dp.(1) + 1 else
      if a = "TLE" then dp.(2) <- dp.(2) + 1 else
      dp.(3) <- dp.(3) + 1
    ); loop (i+1)
  )
let _ = loop 0
let _ = 
  Printf.printf "AC x %d\n" dp.(0); Printf.printf "WA x %d\n" dp.(1); Printf.printf "TLE x %d\n" dp.(2); Printf.printf "RE x %d\n" dp.(3)