process.stdin.resume();
process.stdin.setEncoding("utf8");
process.stdin.on("data", (input) => {
  let current = input;
  const calculated = {
    AC: 0,
    WA: 0,
    TLE: 0,
    RE: 0,
  };
  do {
    const matched = current.match(/^\w+\n/);
    const val = matched ? matched[0].replace("\n", "") : current;
    const trimed = val.trim();
    if (trimed && isNaN(trimed)) {
      calculated[trimed]++;
    }
    current = current.replace(/^\w+\n*/, "");
  } while (current.length > 0);
  const result = Object.keys(calculated)
    .map((key) => `${key} x ${calculated[key]}`)
    .join("\n");
  console.log(result);
});

// const DEFS = ["AC", "WA", "TLE", "RE"];

// const count = (array, value) => {
//   return array.filter((val) => val === value).length;
// };

// process.stdin.on("data", (input) => {
//     const array = input.split("\n");
//     const answers = array.slice(1);
//     const result = DEFS.map((val) => {
//       return `${val} x ${count(answers, val)}`;
//     }).join("\n");
//     console.log(result);
//   });

//   const DEFS = ["AC", "WA", "TLE", "RE"];

//   const count = (array, value) => {
//     return array.filter((val) => val === value).length;
//   };
