object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val s = List.fill(n)(sc.next())
  val res = List("AC", "WA", "TLE", "RE")
  for(r <- res) {
    println(s"$r x ${s.count(_ == r)}")
  }
}