#include <bits/stdc++.h>
int main(void) {
  int N;
  char S[2000000][4];
  char *AC = "AC";
  char *WA = "WA";
  char *TLE = "TLE";
  char *RE = "RE";
  int Nac = 0;
  int Nwa = 0;
  int Ntle = 0;
  int Nre = 0;
  int i;
  printf("hello\n");
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%s", &S[i]);
  }
  for (i = 0; i < N; i++) {
    if (strncmp(S[i], AC, 2) == 0) {
      Nac = Nac + 1;
    } else if (strncmp(S[i], WA, 2) == 0) {
      Nwa = Nwa + 1;
    } else if (strncmp(S[i], TLE, 2) == 0) {
      Ntle = Ntle + 1;
    } else if (strncmp(S[i], RE, 2) == 0) {
      Nre = Nre + 1;
    }
  }
  printf("AC x %d\n", Nac);
  printf("WA x %d\n", Nwa);
  printf("TLE x %d\n", Ntle);
  printf("RE x %d\n", Nre);
  return 0;
}
