object Main {
  def main(args: Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    val N = sc.nextInt()
    val S = List.fill(N)(sc.next())
    val res = List("AC", "WA", "TLE", "RE")
    for(r <- res){
      println(s"$r x ${S.count(_ == r)}")
    }
  }
}
