function main(input) {
  const n = parseInt(input[0]);

  const tag = {"AC":0,"WA":0,"TLE":0,"RE":0}

  for(let i=0;i<n;i++){
    let a = input[i+1];
    tag[a]=tag[a]+1;
  }
  for (let value of Object.keys(tag)) {
    console.log(value+" x "+tag[value])
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));