"use strict";

function main(input) {
  input = input.trim().split("\n");
  const line_one = parseInt(input[0]);

  let AC = 0;
  let WA = 0;
  let TLE = 0;
  let RE = 0;

  for (let i = 1; i <= line_one; i++) {
    if (input[i] === "AC") AC++;
    if (input[i] === "WA") WA++;
    if (input[i] === "TLE") TLE++;
    if (input[i] === "RE") RE++;
  }

  console.log(`AC x ${AC}`);
  console.log(`WA x ${WA}`);
  console.log(`TLE x ${TLE}`);
  console.log(`RE x ${RE}`);
}

function numberSort(array) {
  array.sort(f);
  return array;
}

var f = function (a, b) {
  return a - b;
};

main(require("fs").readFileSync("/dev/stdin", "utf-8"));
