function main(lines) {
  const input = lines.split('\n')
  
  let AC = 0;
  let WA = 0;
  let TLE = 0;
  let RE = 0;
  
  for(let i=1; i<input.length; i++){
      if(input[i] === 'AC') AC++
      if(input[i] === 'WA') WA++
      if(input[i] === 'TLE') TLE++
      if(input[i] === 'RE') RE++
  }
  console.log('AC' + ' x ' + AC)
  console.log('WA' + ' x ' + WA)
  console.log('TLE' + ' x ' + TLE)
  console.log('RE' + ' x ' + RE)
}

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