fun main() {
    var C = mutableListOf(0, 0, 0, 0)
    val n = readLine()!!.toInt()
    for (i in 0 until n) {
        when (readLine()!!) {
            "AC"  -> C[0] += 1
            "WA"  -> C[1] += 1
            "TLE" -> C[2] += 1
            "RE"  -> C[3] += 1
        }
    }
    println("AC x ${C[0]}\nWA x ${C[1]}\nTLE x ${C[2]}\nRE x ${C[3]}\n")
}
