fun main(){

    var acCount = 0;
    var waCount = 0;
    var tleCount = 0;
    var reCount = 0;

    val input = readLine()!!.toInt()


    var array = arrayListOf<String>()

    var map = hashMapOf<String,Int>()

    for (i in 1..input){
        var str = readLine()!!
        array.add(str)
    }

    for (str in array){

        when(str){
            "AC" -> {
                acCount++
            }
            "WA" -> {
                waCount++
            }
            "TLE" -> {
                tleCount++
            }
            "RE" -> {
                reCount++
            }
        }
    }

    println("AC x " + acCount)
    println("WA x " + waCount)
    println("TLE x " + tleCount)
    println("RE x " + reCount)

}
