fun main() {
    val n = readLine()!!.toInt()
    val verdicts = mutableMapOf<String, Int>()
    repeat(n) {
        val verdict = readLine()!!
        verdicts[verdict] = verdicts[verdict]?.plus(1) ?: 1
    }
    listOf("AC", "WA", "TLE", "RE").forEach { verdict -> println("$verdict x ${verdicts[verdict] ?: 0}") }
}
