import Foundation

let n = Int(readLine()!)!
var lines = [String]()

for _ in 0..<n {
    lines.append(readLine()!)
}

for word in ["AC", "WA", "TLE", "RE"] {
    print("\(word) x \(lines.lazy.filter { $0 == word }.count)")
}
