const main = (standardInput) => {
  a = standardInput.split("\n")
  n = parseInt(a[0])
  m = {}
  for(var i = 0; i<n; i++){
    s = a[i+1]
    if(!m[s]) m[s] = 0
    m[s]++
  }
  ['AC', 'WA', 'TLE', 'RE'].forEach((ss)=>{
    console.log(ss + " x " + (m[ss]||0) )
  })
}

main(require('fs').readFileSync('/dev/stdin', 'UTF-8'));