function Main(arg) {
  let n = arg.trim().split('\n');
  let ac = 0,wa = 0,tle = 0,re = 0;
  for(i = 1;i<n.length;i++){
    if(n[i] == 'AC') ac++;
    if(n[i] == 'WA') wa++;
    if(n[i] == 'TLE') tle++;
    if(n[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"));
