#include <stdio.h>
 
int main(void){
  int N;
  int A = 0;
  int W = 0;
  int T = 0;
  int R = 0;
  scanf("%d",&N);
  char data[N];
  
  char judge[] = {AC, WA, TLE, RE};
  fgets(data,N,stdin);
 
  for(int i = 0;i < N;i++){
    if(strcmp(data[i],judge[0])==0){
      A++;
    }else if(strcmp(data[i],judge[1])==0){
      W++;
    }else if(strcmp(data[i],judge[2])==0){
      T++;
    }else if(strcmp(data[i],judge[3])==0){
      R++;
    }
  }
  printf("AC x %d\n", A);
  printf("WA x %d\n", W);
  printf("TLE x %d\n", T);
  printf("RE x %d\n", R);
  
  return 0;
}