import java.util.Scanner

import scala.collection.mutable.ArrayBuffer

object Main {

  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val n = sc.nextInt()
    val v = Vector.fill(n)(sc.next())

    println("AC x " + v.count(_ == "AC"))
    println("WA x " + v.count(_ == "WA"))
    println("TLE x " + v.count(_ == "TLE"))
    println("RE x " + v.count(_ == "RE"))
  }
}
