let () = Scanf.scanf "%d\n" @@ fun n ->
  let a = Array.make 4 0 in
  for i = 0 to n - 1 do
    let i = Scanf.scanf "%s\n" @@ function
      | "AC" -> 0
      | "WA" -> 1
      | "TLE" -> 2
      | "RE" -> 3 in
    a.(i) <- 1 + a.(i)
  done;
  Printf.printf "AC x %d\nWA x %d\nTLE x %d\nRE x %d\n" a.(0) a.(1) a.(2) a.(3)