const [n, ...ss] = require('fs').readFileSync('/dev/stdin', 'utf8').split(/\n/)
const result = {AC: 0, WA: 0, TLE: 0, RE: 0}
for (s of ss) {
  result[s] += 1
}
for (const key of Object.keys(result)) {
  console.log(`${key} x ${result[key]}`)
}