function Main(input) {

	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
    let N = parseInt(input[0]);
    
    input.shift();
    
    let case_num = {
        "ac": 0,
        "wa": 0,
        "tle": 0,
        "re": 0
    };
    
    let S = input.forEach(value => {
        
        switch(value) {
            case "AC":
                case_num.ac++;
                break;
            case "WA":
                case_num.wa++;
                break;
            case "TLE":
                case_num.tle++;
                break;
            case "RE":
                case_num.re++;
                break;
        }
        
    });
    
    console.log("AC x " + case_num.ac);
    console.log("WA x " + case_num.wa);
    console.log("TLE x " + case_num.tle);
    console.log("RE x " + case_num.re);
    
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));