fun main() {
    val map = hashMapOf<String, Int>()
    val n = nextInt()
    map["AC"] = 0
    map["WA"] = 0
    map["TLE"] = 0
    map["RE"] = 0
    repeat(n) {
        val s = next()
        map.computeIfPresent(s){k,v -> v+1}
    }
    println("AC x ${map["AC"]}\n" +
            "WA x ${map["WA"]}\n" +
            "TLE x ${map["TLE"]}\n" +
            "RE x ${map["RE"]}\n")
}

val sc = java.util.Scanner(System.`in`)
fun next(): String = sc.next()
fun nextInt() = sc.nextInt()
fun nextIntArray(size: Int) = IntArray(size) { nextInt() }
fun nextLong() = sc.nextLong()
fun nextLine(): String = sc.nextLine()