import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val N = sc.nextInt
  val S = Array.fill(N+1)(sc.nextLine)

  println(s"AC x ${S.count(_ == "AC")}")
  println(s"WA x ${S.count(_ == "WA")}")
  println(s"TLE x ${S.count(_ == "TLE")}")
  println(s"RE x ${S.count(_ == "RE")}")
}
