import Foundation

func main() {
    let aryKeyItem = ["AC","WA","TLE","RE"]
    var dicCount = ["AC": 0,"WA": 0,"TLE": 0,"RE": 0]
    
    let n = Int(readLine()!)!
    
    for _ in 1...n {
        dicCount[readLine()!]! += 1
    }
    
    aryKeyItem.forEach({
        print("\($0) x \(dicCount[$0]!)")
    })
}
main()
