import scala.io.StdIn

object Main extends App {
  var N = StdIn.readInt()
  var C0, C1, C2, C3 = 0
  for(i <- 0 to N - 1) {
    var S = StdIn.readLine()
    S match {
      case "AC"  => C0 += 1 
      case "WA"  => C1 += 1
      case "TLE" => C2 += 1
      case "RE " => C3 += 1
    }
  }

  println("AC x "  + C0.toString)
  println("WA x "  + C1.toString)
  println("TLE x " + C2.toString)
  println("RE x "  + C3.toString)
}