function main(lines) {
  const N = +lines.shift();
  
  const stat = {
    AC: 0,
    WA: 0,
    TLE: 0,
    RE: 0,
  };
  
  lines.forEach(res => {
    stat[res]++;
  });
  const res = `AC x ${stat.AC}
WA x ${stat.WA}
TLE x ${stat.TLE}
RE x ${stat.RE}`;
  
  console.log(res);
}


main( require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n") );



function splitN(s) {
  return s.split(' ').map(Number);
}
