// https://atcoder.jp/contests/abc173/tasks/abc173_b

const main = (args) => {
  const [N] = args[0].split(' ').map(Number);
  const c = [0, 0, 0, 0];
  
  for (let i=1, len=args.length; i<len; i++) {
    switch (args[i]) {
    case 'AC':  c[0]++; break;
    case 'WA':  c[1]++; break;
    case 'TLE': c[2]++; break;
    case 'RE':  c[3]++; break;
    }
  }
  
  console.log('AC x '+c[0]);
  console.log('WA x '+c[1]);
  console.log('TLE x '+c[2]);
  console.log('RE x '+c[3]);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n'));
