import Foundation

let testCaseCount = Int(readLine()!)!
var ac = 0, wa = 0, tle = 0, re = 0;
for _ in 0..<testCaseCount {
    let result = readLine()!
    switch result {
    case "AC":
        ac += 1
    case "WA":
        wa += 1
    case "TLE":
        tle += 1
    case "RE":
        re += 1
    default:
        print("")
    }
}

print("AC x \(ac)")
print("WA x \(wa)")
print("TLE x \(tle)")
print("RE x \(re)")
