function *main() {
  let N = Number(yield);
  var ac=0, wa=0, tle=0, re=0;
  for(let i=0; i<N; i++){
    let S = (yield);
    switch(S){
      case "AC": ac++;break;
      case "WA": wa++;break;
      case "TLE": tle++;break;
      case "RE": re++;break;
    }
  }
  console.log("AC x "+ac);
  console.log("WA x "+wa);
  console.log("TLE x "+tle);
  console.log("RE x "+re);
}
const iter = main();
iter.next();
require("readline").createInterface(
  {input: process.stdin, output: process.stdout}
).on("line", line => iter.next(line));