function main(input){
  let [N, ...sList] = input.split('\n')
  N = parseInt(N, 10)
  const ls = {AC: 0, WA: 0, TLE: 0, RE: 0}
  for (let i = 0; i < N; i++) {
    const str = sList[i]
    switch (str) {
      case 'AC':
      case 'WA':
      case 'TLE':
      case 'RE':
        ls[str]++
      	break
      default:
      	break
    }
  }
  console.log(`AC x ${ls.AC}
WA x ${ls.WA}
TLE x ${ls.TLE}
RE x ${ls.RE}
`) 
}

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