import Foundation

let N = Int(readLine()!)!
var AC = 0
var WA = 0
var TLE = 0
var RE = 0

for i in 1...N {
    let judge = readLine()!
    
    if judge == "AC" {
        AC += 1
    }else if judge == "WA" {
        WA += 1
    }else if judge == "TLE" {
        TLE += 1
    }else if judge == "RE" {
        RE += 1
    }
    
}

print("AC" + " x " + String(AC))
print("WA" + " x " + String(WA))
print("TLE" + " x " + String(TLE))
print("RE" + " x " + String(RE))