func readInt() -> Int {
    return Int(readLine()!)!
}

func mainB() {
    let N = readInt()

    var counts = [0, 0, 0, 0]
    let results = ["AC", "WA", "TLE", "RE"]
    (0..<N).forEach { _ in
        let result = readLine()!
        counts[results.firstIndex(of: result)!] += 1
    }

    (0...3).forEach { n in
        print(results[n], "x", counts[n])
    }
}

mainB()