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

int main() {
  int i, N, C0=0, C1=0, C2=0, C3=0, C4=0;
  
  scanf("%d", &N);
  
  char S[N][4];
  
  for(i=0; i<N; i++) {
    scanf("%s", S[i]);
  }
  
  for(i=0; i<N; i++) {
    if(strcmp(S[i],"AC") == 0) {
      C0++;
    } else if(strcmp(S[i],"WA") == 0) {
      C1++;
    } else if(strcmp(S[i],"TLE") == 0) {
      C2++;
    } else if(strcmp(S[i],"RE") == 0) {
      C3++;
    } else {
      C4++;
    }
  }
  
  printf("AC x %d", C0);
  printf("WA x %d", C1);
  printf("TLE x %d", C2);
  printf("RE x %d", C3);