fun main() {
    var n = readLine()!!.toInt()
    var d = mutableMapOf("AC" to 0, "WA" to 0, "TLE" to 0, "RE" to 0)
    for(i in 0 until n) {
        var s = readLine()!!
        d[s] = d[s]!! + 1
    }
    d.forEach{(k, v) ->
        println("$k x $v")
    }
}