function Main(input) {
	input = input.split("\n");
 	var N = input[0];
  
  	var counts = ["AC", "WA", "TLE", "RE"];
  	counts["AC"] = counts["WA"] = counts["TLE"] = counts["RE"] = 0;
  
	for(var i=1;i <= N;i++)
	{
  		var key = input[i];
  		counts[key] = (counts[key])? counts[key] + 1 : 1 ;
	}
  
  	console.log("AC x "+counts['AC']);
	console.log("WA x "+counts['WA']);
  	console.log("TLE x "+counts['TLE']);
  	console.log("RE x "+counts['RE']);
}

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