fun main() {
    val n = readLine()!!.toInt()
    var ac = 0
    var wa = 0
    var tle = 0
    var re = 0
    Array(n){
        val tmp = readline()
        if(tmp == "AC"){
            ac++
        }else if(tmp == "WA"){
            wa++
        }else if(tmp == "TLE"){
            tle++
        }else{
            re++
        }
        println("AC x $ac")
        println("WA x $wa")
        println("TLE x $tle")
        println("RE x $re")
    }
}