#include <bits/stdc++.h>
int main() {
  int N, len, i, A = 0, W = 0, T = 0, R = 0;
  char *s[100000];
  char *p;
  char n[3];
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%s", n);
    len = strlen(n);
    p = (char *)malloc(len + 1);
    strcpy(p, n);
    s[i] = p;
  }
  for (i = 0; i < N; i++) {
    if (strcmp(s[i], "AC") == 0) {
      A++;
    } else if (strcmp(s[i], "WA") == 0) {
      W++;
    } else if (strcmp(s[i], "TLE") == 0) {
      T++;
    } else if (strcmp(s[i], "RE") == 0) {
      R++;
    }
  }
  {
    printf("AC X %d\n", A);
    printf("WA X %d\n", W);
    printf("TLE X %d\n", T);
    printf("RE X %d", R);
  }
  return 0;
}
