import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader
import java.util.*
import kotlin.collections.HashSet
import kotlin.math.*
fun main(){
    var fs = CodeForces.FastReader()
    var n = fs.nextInt()
    var a = IntArray(4)
    for (i in 0 until n) {
        var s = fs.next()
        if(s=="AC") a[0]++
        else if(s=="WA")a[1]++
        else if(s=="TLE")a[3]++
        else if(s=="RE")a[4]++
    }
    println("AC x ${a[0]}\nWA x ${a[1]}\n" +
            "TLE x ${a[2]}\n" +
            "RE x ${a[3]}")
}

class CodeForces {
    internal class FastReader {
        private var br: BufferedReader = BufferedReader(InputStreamReader(System.`in`))
        private var st: StringTokenizer? = null

        operator fun next(): String {
            while (st == null || !st!!.hasMoreElements()) {
                try {
                    st = StringTokenizer(br.readLine())
                } catch (e: IOException) {
                    e.printStackTrace()
                }

            }
            return st!!.nextToken()
        }

        fun nextInt(): Int {
            return Integer.parseInt(next())
        }

        fun nextLong(): Long {
            return java.lang.Long.parseLong(next())
        }

        fun nextDouble(): Double {
            return java.lang.Double.parseDouble(next())
        }

        fun nextLine(): String {
            var str = ""
            try {
                str = br.readLine()
            } catch (e: IOException) {
                e.printStackTrace()
            }
            return str
        }

        fun readIntArray(n: Int): IntArray {
            val a = IntArray(n)
            for (i in 0 until n) a[i] = nextInt()
            return a
        }

        fun readLongArray(n: Int): LongArray {
            val a = LongArray(n)
            for (i in 0 until n) a[i] = nextLong()
            return a
        }

        fun readDoubleArray(n: Int): DoubleArray {
            val a = DoubleArray(n)
            for (i in 0 until n) a[i] = nextDouble()
            return a
        }
    }
}
