let n = Int(readLine()!)!
let sn = (1...n).map { _ in readLine()! }
let result: [String: Int] = sn.reduce(["AC": 0, "WA": 0, "TLE": 0, "RE": 0]) {
    var result = $0
    result[$1]! += 1
    return result
}
print("AC x \(result["AC"]!)")
print("WA x \(result["WA"]!)")
print("TLE x \(result["TLE"]!)")
print("RE x \(result["RE"]!)")