#include <stdio.h>
 
int main() {
  int ac, wa, tle, re, n;
  char temp[5];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", &temp);
    if(strcmp(temp, "AC") == 0){
      ac++;
    }
    if(strcmp(temp, "WA") == 0){
      wa++;
    }
    if(strcmp(temp, "TLE") == 0){
      tle++;
    }
    if(strcmp(temp, "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);
}