import java.util.Scanner

import scala.io.StdIn._

object Main extends App {

  val n = readInt()
  val arr = Array.fill(n)(readLine())

  def solve() = {
    val map = Map(
      "AC" -> 0,
      "WA" -> 0,
      "TLE" -> 0,
      "RE" -> 0,
    )
    val ans = arr.foldLeft(map) { case (acc, str) =>
      acc.updated(str, acc.getOrElse(str, 0)+1)
    }
    s"""
       |AC x ${ans("AC")}
       |WA x ${ans("WA")}
       |TLE x ${ans("TLE")}
       |RE x ${ans("RE")}
     """.stripMargin
  }


  println(solve())

}

