function Main(input) {
  const lines = input.split("\n");
  const cnt = parseInt(lines[0]);
  const obj = {
  	"AC":0,
    "WA":0,
    "TLE":0,
    "RE":0
  }
  for(let i = 1; i <= cnt; i++){
  	obj[lines[i]]++;
  }
  for(let i in obj){
  	console.log(`${i} x ${obj[i]}`);
  }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));