fun main(args:Array<String>) {
    val N = readLine()!!.toInt()
    val listDict = mutableMapOf("AC" to 0, "WA" to 0, "TLE" to 0, "RE" to 0)
    for(i in 0 until N){
        val a = readLine()!!
        listDict[a] = listDict[a]!!.plus(1)
    }

    for(key in listDict.keys){
        println(key + " " + "x" + " " + listDict[key])
    }

}