const input = require('fs').readFileSync('/dev/stdin', 'utf-8').split('\n')
const keys = ['AC', 'WA', 'TLE', 'RE']
const resultMap = {
  'AC': 0,
  'WA': 0,
  'TLE': 0,
  'RE': 0
}
const len = parseInt(input[0])
for (let i=1; i<=len; i++) {
  resultMap[input[i]] ++
}
keys.forEach(key => {
  console.log(key + ' x ' + resultMap[key])
})