#include <bits/stdc++.h>
int main() {
  int n1 = 0, n2 = 0, n3 = 0, n4 = 0;
  int t, i;
  char s[10];
  scanf("%d", &t);
  while (t--) {
    int n1 = 0, n2 = 0, n3 = 0, n4 = 0;
    switch (scanf("%s", &s)) {
      case 'AC':
        n1 += 1;
        break;
      case 'WA':
        n2 += 1;
        break;
      case 'TLE':
        n3 += 1;
        break;
      case 'RE':
        n4 += 1;
        break;
    }
  }
  printf("AC X %d\n", n1);
  printf("WA X %d\n", n2);
  printf("TLE X %d\n", n3);
  printf("RE X %d\n", n4);
  return 0;
}
