fun str() = readLine()!!
fun int() = str().toInt()

fun main() {
	val n = int()
	val t = Array(n) {str()}

	fun f(v:String) = println("$v x ${t.count {it==v}}")

	f("AC")
	f("WA")
	f("TLE")
	f("RE")
}
