main = (input) => {
  const [n, ...resultArr]  = input.trim().split('\n')
  const counts = {
    AC: 0,
    WA: 0,
    TLE: 0,
    RE: 0,
  };

  for(i = 0; i < resultArr.length; i++)
  {
    counts[resultArr[i]] += 1;
  }
  
  const countArr = Object.keys(counts)
    .map(key => `${key} x ${counts[key]}`)
  
  console.log(countArr.join('\n'))
}

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