const main = async () => {
  const input = require('fs').readFileSync('/dev/stdin', 'UTF-8').trim()
  
  let setting = input.split('\n')

const process = setting[0]

setting.shift()

let answer = {
  'AC': 0,
  'WA': 0,
  'TLE': 0,
  'RE': 0
}

setting.map((key) => {
  answer[key]++
})


Object.keys(answer).map((key) => {
  console.log(key + ' x ' + answer[key])
})
}

main()