#include <bits/stdc++.h>
int main(void) {
  int n;
  int counta = 0;
  int countw = 0;
  int countt = 0;
  int countr = 0;
  char a[5];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", a);
    if (a[0] == 'A' && a[1] == 'C') {
      counta++;
    }
    if (a[0] == 'W' && a[1] == 'A') {
      countw++;
    }
    if (a[0] == 'T' && a[1] == 'L' && 'E') {
      countt++;
    }
    if (a[0] == 'R' && a[1] == 'E') {
      countr++;
    }
  }
  printf("AC * %d\n", counta);
  printf("WA * %d\n", countw);
  printf("TLE * %d\n", countt);
  printf("RE * %d\n", countr);
  return 0;
}
