#include <stdio.h>
 
int main(void){
  int N, C;
  int A = 0;
  int W = 0;
  int T = 0;
  int R = 0;
  scanf("%d",&N);
  
  for(int i = 0; i < N; i++){
    if(scanf("%s",&C) == "AC"){
      A++;
    }else if(scanf("%s",&C) == "WA"){
      W++;
    }else if(scanf("%s",&C) == "TLE"){
      T++;
    }else if(scanf("%s",&C) == "RE"){
      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;
}