function B173(_input) {
    var lines = _input.split("\n");
    var num = lines.shift();
    var result = {
        'AC': 0,
        'WA': 0,
        'TLE': 0,
        'RE': 0,
    };

    for (var i = num - 1; i >= 0; i--) {
        result[lines[i]]++;
    }
    
    console.log('AC x ' + result['AC']);
    console.log('WA x ' + result['WA']);
    console.log('TLE x ' + result['TLE']);
    console.log('RE x ' + result['RE']);
}
B173(require("fs").readFileSync("/dev/stdin", "utf8"));