let results = ["AC", "WA", "TLE", "RE"]

var count = ["AC": 0, "WA": 0, "TLE": 0, "RE": 0]
let N = Int(readLine()!)!
for _ in 0..<N {
    count[readLine()!]! += 1
}

results.forEach({
    print($0 + " x " + String(count[$0]!))
})
