import java.util.Scanner;

fun main (args : Array<String>) {
  val input = Scanner(System.`in`)
  
  while (input.hasNext()) {
    val n = input.nextInt()
    var countAC = 0
    var countWA = 0
    var countTLE = 0
    var countRE = 0
    
    for (i in 1..n) {
      val veridict = input.next()
      
      when (veridict) {
        "AC" -> ++countAC
        "WA" -> ++countWA
        "TLE" -> ++countTLE
        "RE" -> ++countRE
      }
    }
    
    println("AC x $countAC")
    println("WA x $countWA")
    println("TLE x $countTLE")
    println("RE x $countRE")
  }
}