const main = async () => {
  const input = require('fs').readFileSync('/dev/stdin', 'UTF-8').trim()
  const array = input.split('\n')
  const n = array.shift()
  const results = {
    AC: 0,
    WA: 0,
    TLE: 0,
    RE: 0
  }
  array.forEach((item) => results[item]++)
  const result = ['AC', 'WA', 'TLE', 'RE'].map((item) => {
    return `${ item } x ${ results[item] }`
  })
  console.log(result.join('\n'))
}

main()