function main(input){
  
  var N=input[0];
  var JC=input.split("\n");
	var AC=0;
	var WA=0;
	var TLE=0;
	var RE=0;
	var ss = new Array(JC);
 for (var i = 0;  i < ss.length; i++) {
	    if(ss[i] == AC){
	        AC++;
	    }else if(ss[i] == WA){
	        WA++;
	    }else if(ss[i] == TLE){
	        TLE++;
	    }else if(ss[i] == RE){
	        RE++;
	    }
			
	}
console.log("AC x "+AC);
console.log("WA x "+WA);
console.log("TLE x "+TLE);
console.log("RE x "+RE);
}

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