fun main(){
    val n = readInt()
    val s = ArrayList<Int>()
    var nAc = 0
    var nWa = 0
    var nTle = 0
    var nRe = 0
    for (i in 1..n){
        when(readLine()){
            "AC" -> nAc++
            "WA" -> nWa++
            "TLE" -> nTle++
            "RE" -> nRe++
        }
    }

    println("AC x $nAc")
    println("WA x $nWa")
    println("TLE x $nTle")
    println("RE x $nRe")
}

fun readInt() : Int{
    return readLine()!!.toInt()
}