var testCase: Int = Int(readLine()!)!
var ac: Int = 0
var wa: Int = 0
var tle: Int = 0
var re: Int = 0

for i in 1...testCase {
    var resultCode: String = readLine()!
    
    switch resultCode {
    case "AC":
        ac += 1
    case "WA":
        wa += 1
    case "TLE":
        tle += 1
    case "RE":
        re += 1
    default:
        continue
    }
}

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