#include<stdio.h>
 
int main(){
  
  int i, n;
  int AC, WA, TLE, RE;
  
  char judge[100];
  char name[] = {'AC','WA','TLE','RE','\0'};
  
  scanf("%d" ,&n);
  
  for(i = 0; i < n; i++){
    
    scanf("%s" ,judge[i]);
    
    if(judge[i] == name[0]){
      AC += 1;
    }else if(judge[i] == name[1]){
      WA += 1;
    }else if(judge[i] == name[2]){
      TLE += 1;
    }else if(judge[i] == name[3]){
      RE += 1;
    }
            
  }
          
   printf("AC x %d\n", AC); 
   printf("WA x %d\n", WA);
   printf("TLE x %d\n", TLE); 
   printf("RE x %d\n", RE); 
             
   return 0;
             
 }