import Foundation

extension String {
    func wordsMap<T>(_ f: (Substring) -> T?) -> [T] {
        return self.split(separator: " ").compactMap(f)
    }
}

private func readWords<T>(_ f: (Substring) -> T?) -> [T] {
    return readLine()!.wordsMap(f)
}

extension Optional {
    func pleaseAC(){
        print(self!)
    }
}

readLine().map { line -> Any in 
    let n = Int(line)!
    var ans = [String:Int]()

    for _ in 1...n {
        let s = readLine()!
        ans[s, default: 0] += 1
    }

    for s in ["AC","WA","TLE","RE"] {
        print("\(s) x　\(ans[s] ?? 0)")
    }
    
    return ""
}
.pleaseAC()
