fun main (args: Array<String>) {
    val n = readLine()!!.toInt()
    val sList = List(n) {
        readLine()!!.toString()
    }

    var acNum = 0
    var waNum = 0
    var tleNum = 0
    var reNum = 0

    sList.forEach {
        when (it) {
            "AC" -> acNum++
            "WA" -> waNum++
            "TLE" -> tleNum++
            "RE" -> reNum++
            else -> {}
        }
    }

    println("AC x $acNum")
    println("WA x $waNum")
    println("TLE x $tleNum")
    println("RE x $reNum")
}