let N = Int(readLine()!)!
var sArr:[String]
var acCount = 0
var waCount = 0
var tleCount = 0
var reCount = 0
for i in 0..<N{
  let str = readLine()!
  if str == "AC"{
    acCount += 1
  }else if str == "WA"{
  	waCount += 1
  }else if str == "TLE"{
  	tleCount += 1
  }else if str == "RE"{
  	reCount += 1
  }
}

print("AC x \(acCount)")
print("WA x \(waCount)")
print("TLE x \(tleCount)")
print("RE x \(reCount)")
