function Main(input) {
	input = input.split("\n");
	
	var n = parseInt(input[0], 10);
	var s = [];
	
	for (var i = 1; i < n + 1; i++) {
	s.push(input[i]);
	}
	
	var AC = s.filter(item => item === 'AC')
	var WA = s.filter(item => item === 'WA')
	var TLE = s.filter(item => item === 'TLE')
	var RE = s.filter(item => item === 'RE')
	
	console.log("AC x " + AC.length);
	console.log("WA x " + WA.length);
	console.log("TLE x " + TLE.length);
	console.log("RE x " + RE.length);
	
	}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));