let rec judge lst = match lst with
    [] -> (0, 0, 0, 0)
  | first :: rest ->
      let judge_rest = judge rest in
      match judge_rest with
        (ac, wa, tle, re) -> if first = "AC" then (ac + 1, wa, tle, re)
                             else if first = "WA" then (ac, wa + 1, tle, re)
                             else if first = "TLE" then (ac, wa, tle + 1, re)
                             else (ac, wa, tle, re + 1) (* AC,WA,TLE,RE *)
                             
let rec result_list n =
  if n = 0 then []
  else read_line () :: result_list (n - 1)

let ans =  judge (result_list (read_int ()))

let () = match ans with
  (ac, wa, tle, re) ->
    (print_string @@ "AC x " ^ (string_of_int ac); print_newline();
     print_string @@ "WA x " ^ (string_of_int wa); print_newline();
     print_string @@ "TLE x " ^ (string_of_int tle); print_newline();
     print_string @@ "RE x " ^ (string_of_int re);print_newline();
    )

