fun main(args: Array<String>) {
    val n  =readLine()!!.toInt()
    val list = List(n) {
        readLine()!!
    }
    var count0 = 0
    var count1 = 0
    var count2 = 0
    var count3 = 0
    for(i in 0 until n) {
        when(list[i]) {
            "AC" -> count0++
            "WA" -> count1++
            "TLE" -> count2++
            "RE" -> count3++
            else -> {}
        }
    }
    println("AC x $count0")
    println("WA x $count1")
    println("TLE x $count2")
    println("RE x $count3")
}