function main(input = "") {
    const lines = input.split("\n");
    const datas = ["AC", "WA", "TLE", "RE"];
    let cnts = new Int32Array(4);

    for (let i = 1; i < lines.length; i++) {
        for (let k = 0; k < 4; k++) {
            if (lines[i] === datas[k]) {
                cnts[k]++;
                break;
            }
        }
    }

    let res = "";
    for(let i = 0; i < 4; i++){
        res += `${datas[i]} x ${cnts[i]}` + "\n"
    }
    res = res.trim();
    return res;
}

//******************************
exports.main = main;

function Main(input) {
    console.log(main(input.trim()));
}

if (process.argv[2] !== "test") {
    Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}
