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

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

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

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