let N = Int(readLine()!)!
var res: [Int] = Array(repeating: 0, count: 4)

for _ in 1...N {
    let S: String = readLine()!
    if S == "AC" {
        res[0] += 1
    } else if S == "WA" {
        res[1] += 1
    } else if S == "TLE" {
        res[2] += 1
    } else {
        res[3] += 1
    }
}

print("""
AC x \(res[0])
WA x \(res[1])
TLE x \(res[2])
RE x \(res[3])
""")    // (๑•ૅㅁ•๑)