function main(input){
  input = input.split('\n');
  const N = Number(input[0]);
  const S = input.slice(1, N+1);
  const result = {
    AC: 0,
    WA: 0,
    TLE: 0,
    RE: 0,
  };

  S.forEach(s =>{
    result[s]++;
  });

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

}


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