"use strict"
function main(arg) {
    let data = arg.trim().split("\n")
    data.shift()
    let list = {
        'AC': 0,
        'WA': 0,
        'TLE': 0,
        'RE': 0,
    }
    for (let i = 0; i < data.length; i++) {
        let l = data[i]
        list[l]++
        // console.log(l)
    }
    console.log(`AC x ${list['AC']}`)
    console.log(`WA x ${list['WA']}`)
    console.log(`TLE x ${list['TLE']}`)
    console.log(`RE x ${list['RE']}`)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));