const Main = input => {
    input = input.split("\n");
    const n = parseInt(input[0], 10);
    input.shift();
    const s = input;

    let ac = 0;
    let wa = 0;
    let tle = 0;
    let re = 0;

    for(let i = 0; i < n; i++) {
        switch(s[i]) {
            case "AC":
                ac++;
                break;
            case "WA":
                wa++;
                break;
            case "TLE":
                tle++;
                break;
            case "RE":
                re++;
                break;
            default:
                break;
        }
    }

    console.log(`AC x ${ac}
WA x ${wa}
TLE x ${tle}
RE x ${re}`);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));