'use strict';

function Main(input) {
    const tmp = input.trim().split('\n').splice(1);
    const result = {
        AC: 0,
        WA: 0,
        TLE: 0,
        RE: 0,
    };

    for (const v of tmp) {
        result[v]++;
    }
    console.log(`AC x ${result.AC}`);
    console.log(`WA x ${result.WA}`);
    console.log(`TLE x ${result.TLE}`);
    console.log(`RE x ${result.RE}`);

    return;
}
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));