import Foundation

let N = Int(readLine()!)!

var countAC = 0
var countWA = 0
var countTLE = 0
var countRE = 0

for _ in 0..<N {
    switch readLine()! {
    case "AC":
        countAC += 1
    case "WA":
        countWA += 1
    case "TLE":
        countTLE += 1
    case "RE":
        countRE += 1
    default:
        fatalError()
    }
}

print("AC x \(countAC)")
print("WA x \(countWA)")
print("TLE x \(countTLE)")
print("RE x \(countRE)")
