"use strict";

const main = (input) => {
    const spi = input.split('\n');
    const n = parseInt(spi[0]);
    const map = new Map([["AC", 0], ["WA", 0], ["TLE", 0], ["RE", 0],]);
    
    for (let i = 1; i < n + 1; i++) {
        map.set(spi[i], map.get(spi[i])+1);
    }

    for (let entry of map.entries()) {
        console.log(entry[0] + " x " + entry[1]);
    }
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));
