console.log((args=>{
  const [N,...S] = args.trim().split('\n');
  let AC = 0, WA = 0, TLE = 0, RE = 0;
  for ( let i = 0; i < N; i++ ) {
    switch(S[i]){
      case 'AC': AC++; break;
      case 'WA': WA++; break;
      case 'TLE': TLE++; break;
      case 'RE': RE++; break;
    }
  }
  return `AC x ${AC}\nWA x ${WA}\nTLE x ${TLE}\nRE x ${RE}`;
})(require('fs').readFileSync('/dev/stdin', 'utf8')));