import java.util.*

fun main(args: Array<String>) {
    val pw = java.io.PrintWriter(System.out)
    Problem.solve(Scanner(System.`in`), pw)
    pw.flush()
}

object Problem {
    data class Way(val to: Int, val t: Int)

    fun solve(sc: Scanner, pw: java.io.PrintWriter) {
        val N = sc.next().toInt()
        val A = mutableMapOf<String, Int>()
        repeat(N) {
            val S = sc.next()
            A[S] = (A[S] ?: 0) + 1
        }
        pw.printf(
            "AC x %d\n" +
                    "WA x %d\n" +
                    "TLE x %d\n" +
                    "RE x %d\n", A["AC"] ?: 0, A["WA"] ?: 0, A["TLE"] ?: 0, A["RE"] ?: 0
        )
    }
}
