"use strict";

const main = arg => {
    let input = arg.split('\n');
    let AC = 0;
    let WA = 0;
    let TLE = 0;
    let RE = 0;
    
    for (let i = 1; i < input[0]+1; i++) {
        if (input[i] == 'AC') {
            AC = AC +1;
        } else if(input[i] == 'WA') {
            WA = WA + 1;
        } else if(input[i] == 'TLE') {
            TLE = TLE + 1;
        } else if(input[i] == 'RE') {
            RE = RE + 1;
        }
    }
    
    console.log('AC x ' + AC)
    console.log('WA x ' + WA)
    console.log('TLE x ' + TLE)
    console.log('RE x ' + RE)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));  