import Foundation

let n = Int(readLine()!)!
var ac = 0
var wa = 0
var tle = 0
var re = 0
for i in 1...n{
  let a = readLine()!
  if(a == "AC"){
    ac += 1
  }else if(a == "WA"){
    wa += 1
  }else if(a == "TLE"){
    tle += 1
  }else{
    re += 1
  }
}
print("AC x \(ac)")
print("WA x \(wa)")
print("TLE x \(tle)")
print("RE x \(re)")