const input = require('fs').readFileSync('/dev/stdin', 'utf-8').split('\n');
const n = Number(input.shift());
let ac = 0;
let wa = 0;
let tle = 0;
let re = 0
for (let i = 0; i < n; i++){
    if (input[i] === 'AC') {
        ac++;
    } else if (input[i] === 'WA') {
        wa++;
    } else if (input[i] === 'TLE') {
        tle++;
    } else if (input[i] === 'RE') {
        re++
    } else {
        continue;
    }
}
console.log(`AC x ${ac}`);
console.log(`WA x ${wa}`);
console.log(`TLE x ${tle}`);
console.log(`RE x ${re}`);