"use strict";

const main = arg => {
    const inputList = arg.trim().split("\n");
    // 回答を記述
    const N = parseInt(inputList[0].split(" ")[0]);
    const AC = "AC"
    const WA = "WA"
    const TLE = "TLE"
    const RE = "RE"
    let rst = new Array(4).fill(0);
    for (let i = 1; i <= N; i++) {
        if (inputList[i] === AC) {
            rst[0]++
        } else if (inputList[i] === WA) {
            rst[1]++
        } else if (inputList[i] === TLE) {
            rst[2]++
        } else {
            rst[3]++
        }
    }

    console.log("AC x " + rst[0] + "\nWA x " + rst[1] + "\nTLE x " + rst[2] + "\nRE x " + rst[3])

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