data class JudgeStatus(
    var ac: Int,
    var wa: Int,
    var tle: Int,
    var re: Int
)

fun main() {

    val numberTest = readLine()!!.toInt()
    val inputs = mutableListOf<String>()
    repeat(numberTest) {
        inputs.add(readLine()!!)
    }

    val judgeStatus = judge(inputs)

    println("AC x ${judgeStatus.ac}")
    println("WA x ${judgeStatus.wa}")
    println("TLE x ${judgeStatus.tle}")
    println("RE x ${judgeStatus.re}")
}

fun judge(inputs: MutableList<String>): JudgeStatus {
    val judgeStatus = JudgeStatus(0,0,0,0)
    inputs.forEach {
        when(it) {
            "AC" -> judgeStatus.ac++
            "WA" -> judgeStatus.wa++
            "TLE" -> judgeStatus.tle++
            "RE" -> judgeStatus.re++
        }
    }
    return judgeStatus
}