#include<stdio.h>
#include<string.h>
int main(void){
  int i,n,a=0,b=0,c=0,d=0;
  char s[10];
  scanf("%d", &n);
  for(i=0;i<n;i++){
    scanf("%s", &s);
    if(strcmp(s,"AC")==0){
      a++;
    }
    else if(strcmp(s,"WA")==0){
      b++;
    }
    else if(strcmp(s,"TLE")==0){
      c++;
    }
    else(strcmp(s,"RE")==0){
      d++;
    }
  }
  printf("AC x %d\n", a);
  printf("WA x %d\n", b);
  printf("TLE x %d\n", c);
  printf("RE x %d\n", d);
  return 0;
}
