function main(input){
	
var [n, ...sn]=input.split("\n");

const result = {AC: 0, WA: 0, TLE: 0, RE: 0}
for (const s of sn) {
  result[s] += 1
}
console.log(`AC x ${result['AC']}`)
console.log(`WA x ${result['WA']}`)
console.log(`TLE x ${result['TLE']}`)
console.log(`RE x ${result['RE']}`)
  
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));