import scala.io.StdIn.readLine

object Main extends App {
  var Array(datN) = readLine.split(" ").map(_.toInt)
  var C0, C1, C2, C3 = 0
  for(i <- 0 to datN - 1) {
    var datS = readLine()
    datS match {
      case "AC"  => C0 += 1 
      case "WA"  => C1 += 1
      case "TLE" => C2 += 1
      case "RE " => C3 += 1
    }
  }

  println(s"AC x ${C0}")
  println(s"WA x ${C1}")
  println(s"TLE x ${C2}")
  println(s"RE x ${C3}")
}