function Main(input) {
    input = input.trim().split('\n');
    let robj = {
        ac: 0,
        wa: 0,
        tle: 0,
        re: 0
    };
    for(let i=1; i<=parseInt(input[0], 10); i++) {
        switch(input[i]) {
            case 'AC':
                robj.ac += 1;
                break;
            case 'WA':
                robj.wa += 1;
                break;
            case 'TLE':
                robj.tle += 1;
                break;
            case 'RE':
                robj.re += 1;
                break;
        }
    }
    console.log(`AC x ${robj.ac}
WA x ${robj.wa}
TLE x ${robj.tle}
RE x ${robj.re}`);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));