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