fun main() {
  val N = readInt()
  val SN = (1..N).map { readString() }
  println("AC x " + SN.count { it == "AC" })
  println("WA x " + SN.count { it == "WA" })
  println("TLE x " + SN.count { it == "TLE" })
  println("RE x " + SN.count { it == "RE" })
}

fun readString() = readLine()!!
fun readStrings() = readString().split(" ")
fun readInt() = readString().toInt()
fun readLong() = readString().toLong()
fun readInts() = readStrings().map { it.toInt() }
fun readLongs() = readStrings().map { it.toLong() }
