const chunks = [];
process.stdin.on("data", (chunk) => {
  chunks.push(chunk);
});
process.stdin.on("end", () => {
  const data = Buffer.concat(chunks).toString("utf8").trim();
  const lines = data.split("\n");
  const N = parseInt(lines[0], 10);
  const S = lines.slice(1, N + 1);
  solve(N, S);
});

class Counter extends Map {
  increment(key) {
    if (this.has(key)) {
      this.set(key, this.get(key) + 1);
    } else {
      this.set(key, 1);
    }
  }
}

function solve(N, S) {
  const counter = new Counter();
  for (const s of S) {
    counter.increment(s);
  }
  const keys = ["AC", "WA", "TLE", "RE"];
  for (const key of keys) {
    console.log(`${key} x ${counter.get(key) || 0}`);
  }
}
