fun main(args: Array<String>) {
    val testCaseCount = readLine()!!.toInt()
    val testCases = (1..testCaseCount).map { readLine()!! }
    
    val testResults = arrayOf("AC","WA","TLE","RE")
    val counter = hashMapOf<String, Int>()
    
    testResults.forEach { counter[it] = 0 }
    testCases.forEach { counter[it] = counter[it]?.plus(1) ?: 1 }

    testResults.forEach {
        val result = it + " x " + counter[it].toString()
        println(result)
    }
}
