const prompt = require('prompt-sync')({sigint: true});


const num = prompt('');
const realElement=['AC','WA','TLE','RE'];
var arr=new Array(num);
for(let i=0;i<num;i++){
 arr[i]=prompt('');
}

var count=0;
for(let i=0;i<realElement.length;i++){
  
    for(let j=0;j<arr.length;j++){
        if(realElement[i]===arr[j]){
          
            count++;
        }
        
    }
    console.log(`${realElement[i]} X ${count} `);
    count=0;
}