#include <bits/stdc++.h>
int main() {
  int n, i, a = 0, b = 0, c = 0, d = 0;
  scanf("%d", &n);
  char s[n][4];
  for (i = 0; i < n; i++) {
    scanf("%s", s[i]);
    if (s[i][0] == 'A') a++;
    if (s[i][0] == 'W') b++;
    if (s[i][0] == 'T') c++;
    if (s[i][0] == 'R') d++;
  }
  printf("AC * %d\n", a);
  printf("WA * %d\n", b);
  printf("TLE * %d\n", c);
  printf("RE * %d\n", d);
  return 0;
}
