fun main(){
    val key = arrayOf("AC","WA","TLE","RE")
    val n = readLine()!!.toInt()
    val s = Array(n){
        readLine()
    }
    val r = s.groupingBy { it }.eachCount()
    for(k in key){
        println("$k x ${r[k] ?: 0 }")
    }
}