"use strict";

const main = (arg) => {
  const ipt = arg.trim().split("\n");
  let check = {AC: 0, WA: 0, TLE: 0, RE: 0}
  ipt.slice(1).forEach(el => check[el]++);
  for(const key in check){
  	console.log(`${key} x ${check[key]}`);
  }
};
main(require("fs").readFileSync("/dev/stdin", "utf8"));