import Foundation
let rl = Int(readLine()!)!
var ACcount = 0
var WAcount = 0
var TLEcount = 0
var REcount = 0
for i in 0 ..< rl {
    let rl = readLine()!
    switch rl {
    case "AC":
        ACcount += 1
    case "WA":
        WAcount += 1
    case "TLE":
        TLEcount += 1
    default:
        REcount += 1
    }
}

print("AC x \(ACcount)")
print("WA x \(WAcount)")
print("TLE x \(TLEcount)")
print("RE x \(REcount)")