var table: [String: Int] = [:]

let N = Int(readLine()!)!
for _ in 0..<N {
  let res = readLine()!
  table[res, default: 0] += 1
}
for key in ["AC", "WA", "TLE", "RE"] {
  print("\(key) x \(table[key, default: 0])")
}