import scala.math

object Main extends App {
  val sc = new java.util.Scanner(System.in)
  def divisors(n: Int): List[Int] =
    for (i <- (1 to n).toList if n % i == 0) yield i
  var n = sc.nextInt() % 1000
  var s = Array.fill(n)(sc.next())
  var ans = Array.fill(4)(0)
  for(i <- 0 until n){
    if (s(i)=="AC") ans(0)+=1
    if (s(i)=="WA") ans(1)+=1
    if (s(i)=="TLE") ans(2)+=1
    if (s(i)=="RE") ans(3)+=1
  }
  println("AC x " + ans(0).toString)
  println("WA x " + ans(1).toString)
  println("TLE x " + ans(2).toString)
  println("RE x " + ans(3).toString)
}
