function Main(input) {
    let array = input.split("\n");
    let item = parseInt(array[0]);

    let countAC = 0;
    let countWA = 0;
    let countTLE = 0;
    let countRE = 0;
    for (let i =1;i<=item;i++){
        if (array[i] == "AC"){
            countAC++;
        } else if (array[i] == "WA"){
            countWA++;
        } else if (array[i] == "TLE"){
            countTLE++;
        } else if (array[i] == "RE"){
            countRE++;
        }
    }
    console.log("AC x "+countAC);
    console.log("WA x "+countWA);
    console.log("TLE x "+countTLE);
    console.log("RE x "+countRE);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));