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

    var acCount = 0
    var waCount = 0
    var tleCount = 0
    var reCount = 0
    for (i in 0 until n) {
        when (readLine()!!) {
            "AC" -> {
                acCount++
            }
            "WA" -> {
                waCount++
            }
            "TLE" -> {
                tleCount++
            }
            "RE" -> {
                reCount++
            }
        }
    }
    
    println("AC x $acCount")
    println("WA x $waCount")
    println("TLE x $tleCount")
    println("RE x $reCount")
}