
import Foundation

func main(){
   let n = Int(readLine()!)!
   var dict = ["AC":0, "WA":0, "TLE": 0, "RE": 0]
   for _ in 0..<n {
      let si = readLine()!
      dict[si] = (dict[si]!) + 1
   }
   
   print("AC x \(dict["AC"]!)")
   print("WA x \(dict["WA"]!)")
   print("TLE x \(dict["TLE"]!)")
   print("RE x \(dict["RE"]!)")
}
main()