func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let n = Int(readLine()!)!
    var ac = 0
    var wa = 0
    var tle = 0
    var re = 0
    for _ in 0..<n {
        let s = readLine()!
        if s == "AC" {
            ac += 1
        } else if s == "WA" {
            wa += 1
        } else if s == "TLE" {
            tle += 1
        } else {
            re += 1
        }
    }
    print("AC x", ac)
    print("WA x", wa)
    print("TLE x", tle)
    print("RE x", re)
}

main()
