const processData = (lines) => {
    let acc = 0
    const n = +lines[acc]
    const map = {
        'AC': 0,
        'WA': 0,
        'TLE': 0,
        'RE': 0
    }
    const iter = ['AC', 'WA', 'TLE', 'RE']
    acc++
    for (let i=0; i<n; i++) {
        const t = lines[acc]
        map[t]++
        acc++
    }

    for (const c of iter) {
        console.log(`${c} x ${map[c]}`)
    }
}

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/
    processData(lines)
})
