fun main() {
    val n = readLine()!!.toInt()
    val list = (1..n).map { readLine()!! }
    var a = 0
    var w = 0
    var t  = 0
    var r = 0
    for (l in list) {
        when(l) {
            "AC" -> {
                a++
            }
            "WA" -> {
                w++
            }
            "TLE" -> {
                t++
            }
            "RE" -> {
                r++
            }
        }
    }
    println("AC x $a\n" +
            "WA x $w\n" +
            "TLE x $t\n" +
            "RE x $r")
}