import java.util.*
fun main(args: Array<String>) {
    val reader = Scanner(System.`in`)
    val N = reader.nextInt()
    var resultMap = mutableMapOf<String, Int>()
    repeat(N){
        val result = reader.next()
        val currentCnt = resultMap.getOrDefault(result, 0)
        resultMap.put(result, currentCnt + 1)
    }
    listOf<String>("AC", "WA", "TLE", "RE").forEach {
        println("${it} x ${resultMap.getOrDefault(it, 0)}")
    }
}