fun main(args: Array<String>) {
    val n = readLine()!!.toInt()

    val resultMap : MutableMap<String, Long> = mutableMapOf(
            "AC" to 0L,
            "WA" to 0L,
            "TLE" to 0L,
            "RE" to 0L
    )

    for (i in 1..n) {
        val si = readLine()!!
        val value = resultMap[si]!!
        resultMap[si] = value + 1L
    }

    println("AC x ${resultMap["AC"]}")
    println("WA x ${resultMap["WA"]}")
    println("TLE x ${resultMap["TLE"]}")
    println("RE x ${resultMap["RE"]}")
}