object Main {
  def main(args: Array[String]): Unit = {
    import scala.io.StdIn.readLine
    val Array(datN) = readLine.split(" ").map(_.toInt)
    val datA = for(i <- 1 to datN) yield readLine

    val ac = datA.filter(_ == "AC").length
    val wa = datA.filter(_ == "WA").length
    val tle = datA.filter(_ == "TLE").length
    val re = datA.filter(_ == "re").length

    println("AC x " + ac)
    println("WA x " + wa)
    println("TLE x " + tle)
    println("RE x " + re)

  }
}
