function main(input) {
  const inputs =input.split('\n')
  const [N] = inputs[0].split(' ').map(Number)
  const S = inputs.splice(1)
  const count = {
    'AC': 0,
    'WA': 0,
    'TLE': 0,
    'RE': 0,
  }
  for(let i = 0; i < N; i++) {
    count[S[i]]++
  }
  console.log(`AC x ${count['AC']}
WA x ${count['WA']}
TLE x ${count['TLE']}
RE x ${count['RE']}`
  )
}

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