function Main(input) {
    tmp = input.split("\n");
    n = tmp[0];
    s = tmp.shift();
  
    a = 0;
    w = 0;
    t = 0;
    r = 0;

    for (let i = 0; i < tmp.length; i++) {
        if (tmp[i] == 'AC') {
            a += 1;
        }else if (tmp[i] == 'WA') {
            w += 1;
        }else if( tmp[i] == 'TLE') {
            t += 1;
        }else if( tmp[i] == 'RE'){
            r += 1;
        }
    }

    console.log( 'AC x ' + a + '\n' + 'WA x ' + w + '\n' + 'TLE x ' + t + '\n' + 'RE x ' + r + '\n');
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));