#include <bits/stdc++.h>
int main() {
  int N;
  int AC = 0, WA = 0, TLE = 0, RE = 0;
  scanf("%d", &N);
  char a[50][N];
  for (int i = 0; i < N; i++) {
    scanf("%s", a[i]);
    if (strcmp(a[i], "AC") == 0) {
      AC++;
    }
    if (strcmp(a[i], "WA") == 0) {
      WA++;
    }
    if (strcmp(a[i], "TLE") == 0) {
      TLE++;
    }
    if (strcmp(a[i], "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;
}
