function Main(input){
    let arr = input.trim().split('\n');
    let count_AC = 0;
    let count_WA = 0;
    let count_TLE = 0;
    let count_RE = 0;
    for(let i=1; i <= Number(arr[0]); i++){
        if(arr[i] == 'AC')  count_AC++;
        if(arr[i] == 'WA')  count_WA++;
        if(arr[i] == 'TLE') count_TLE++;
        if(arr[i] == 'RE')  count_RE++;
    }
    console.log('AC' + ' x ' + count_AC)
    console.log('WA' + ' x ' + count_WA)
    console.log('TLE' + ' x ' + count_TLE);
    console.log('RE' + ' x ' + count_RE);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));