fun main() {
    var n = readLine()!!.toInt()
    val sList = mutableListOf<String>()

    for(i in 1 .. n){
        sList.add(readLine()!!)
    }

    println("AC x " + sList.filter{it == "AC"}.size)
    println("WA x " + sList.filter{it == "WA"}.size)
    println("TLE x " + sList.filter{it == "TLE"}.size)
    println("RE x " + sList.filter{it == "RE"}.size)

}