const main = input => {
    const query = input.split('\n');
    const N = parseInt(query[0]);

    const memo = {
        'AC': 0,
        'WA': 0,
        'TLE': 0,
        'RE': 0,
    };

    for (let i = 1; i <= N; i++) {
        memo[query[i]]++;
    }

    console.log('AC', 'x', memo['AC']);
    console.log('WA', 'x', memo['WA']);
    console.log('TLE', 'x', memo['TLE']);
    console.log('RE', 'x', memo['RE']);
};


// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"));
// main(require("fs").readFileSync("input.txt", "utf8"));