import scala.io.StdIn._
import scala.collection.mutable._
object Main{
  def main(args:Array[String]) {
    val N = readLine().toInt
    val m = Map("AC"->0, "WA"->0, "TLE"->0, "RE"->0)
    for(i <- 0 until N) {
      m(readLine()) += 1
    }
    println("AC x " + m("AC"))
    println("WA x " + m("WA"))
    println("TLE x " + m("TLE"))
    println("RE x " + m("RE"))
  }
}
