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

fun main() {
    val judgeStatus = judge(readLine()!!.toInt())

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

fun judge(answerCount: Int): JudgeStatus {
    val judgeStatus = JudgeStatus(0,0,0,0)
    repeat(answerCount) {
        when(readLine()!!.toString()) {
            "AC" -> judgeStatus.ac++
            "WA" -> judgeStatus.wa++
            "TLE" -> judgeStatus.tle++
            "RE" -> judgeStatus.re++
        }
    }
    return judgeStatus
}