fun main(){
    val n = readLine()!!.split(" ")[0].toInt()
    var ac = 0
    var wa = 0
    var tle = 0
    var re = 0
    for(i in 0 until n){
        val s = readLine()!!.split(" ")[0]
        if (s == "AC") ac++
        else if(s == "WA") wa++
        else if (s == "TLE") tle++
        else re++
    }
    println("AC x ${ac}")
    println("WA x ${wa}")
    println("TLE x ${tle}")
    println("RE x ${re}")
}