const main = (input) => {
  const args = input.trim().split("\n");
  const N = parseInt(args[0], 10);
  const isAC = s=>s === "AC";
  const n_ac = args.filter(isAC).length;
  const isWA = s=>s === "WA";
  const n_wa = args.filter(isWA).length;
  const isTLE = s=>s === "TLE";
  const n_tle = args.filter(isTLE).length;
  const n_re = N - n_ac - n_wa - n_tle;

  console.log(`AC x ${n_ac}
  WA x ${n_wa}
  TLE x ${n_tle}
  RE x ${n_re}`)
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));