'use strict';

const inputs = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n');
const iS = () => inputs.shift();
const sMpI = (str) => str.split(' ').map(v => parseInt(v, 10));
const sMpIS = () => sMpI(iS());
const pI = v => parseInt(v);

iS();

const resultTypes = ['AC', 'WA', 'TLE', 'RE'];
const results = { AC: 0, WA: 0, TLE: 0, RE: 0 };

for (const input of inputs) {
  ++results[input];
}

for (const resultType of resultTypes) {
  console.log(`${resultType} x ${results[resultType]}`)
}