import scala.io.StdIn
import scala.collection.mutable.{Map => MMap}

object Main extends App {
  val line = StdIn.readInt()

  val map = MMap[String,Int]().withDefaultValue(0)

  for(_ <- 1 to line){
    map(StdIn.readLine()) += 1
  }

  for(str <- Array("AC","WA","TLE","RE")){
    println(s"$str x ${map(str)}")
  }
}
