#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main(){
    int num;
    scanf("%d", &num);

    for(int i = 0; i < num; i++){
        char word[2];

    }



    return 0;
}

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main(void){
	int num;
  	int ignore = scanf("%d",&num);
  	int count[4] = {0};
  
  	for(int i = 0; i<num; i++){
  		char input[2];
      	ignore = scanf("%s",input);
      	if(strcmp(input,"AC") == 0){
        	count[0]++;
        }else if(strcmp(input, "WA") == 0){
          	count[1]++;
        }else if(strcmp(input, "TLE") == 0){
          	count[2]++;
        }else if(strcmp(input, "RE") == 0){
          	count[3]++;
        }
    }
  	printf("AC x %d\n", count[0]);
  	printf("WA x %d\n", count[1]);
  	printf("TLE x %d\n", count[2]);
  	printf("RE x %d", count[3]);
  	ignore++;
  	return 0;
}