fun main(args: Array<String>) {
    val n = readLine()?.toInt() ?: return
    val r = hashMapOf<String, Int>()
    repeat(n) {
        val s = readLine() ?: return
        r[s] = r[s]?.let { it + 1 } ?: 1
    }
    buildString {
        appendln("AC x ${r["AC"] ?: 0}")
        appendln("WA x ${r["WA"] ?: 0}")
        appendln("TLE x ${r["TLE"] ?: 0}")
        appendln("RE x ${r["RE"] ?: 0}")
    }.let {
        println(it.trimIndent())
    }
}
