"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const S = arg.slice(1, N + 1);
    
    let array = [0, 0, 0, 0];
    
    for(let i=0; i<N; i++) {
        if(S[i] === "AC") {
            array[0]++;
        }
        if(S[i] === "WA") {
            array[1]++;
        }
        if(S[i] === "TLE") {
            array[2]++;
        }
        if(S[i] === "RE") {
            array[3]++;
        }
    }
    
    for(let i=0; i<4; i++) {
        if(i === 0) {
            console.log("AC x " + array[0]);
        }  
        if(i === 1) {
            console.log("WA x " + array[1]);
        }  
        if(i === 2) {
            console.log("TLE x " + array[2]);
        }  
        if(i === 3) {
            console.log("RE x " + array[3]);
        }  
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));