'use strict';
function Main(stdin){
  const input = stdin.trim().split(/\r?\n/g);
  const N = Number(input.shift());
  let C_0 = 0, C_1 = 0, C_2 = 0, C_3 = 0;

  for(let i = 0; i < N; i++){
    switch(input[i]){
      case 'AC':
        C_0++;
        break;
      case 'WA':
        C_1++;
        break;
      case 'TLE':
        C_2++;
        break;
      case 'RE':
        C_3++;
        break;
      default:
        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"));