#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int MAX = 2e5 + 10;
const int mod = 1e9 + 7;
char judge[4][5] = {"AC", "WA", "TLE", "RE"};
int sum[26];
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    memset(sum, 0, sizeof(sum));
    while (n--) {
      char str[5];
      scanf("%s", str);
      sum[str[0] - 'A']++;
    }
    for (int i = 0; i < 4; i++) {
      char ch = judge[i][0];
      printf("%s * %d\n", judge[i], sum[judge[i][0] - 'A']);
    }
  }
  return 0;
}
