#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
int n, m, q;
int da[maxn];
inline int read() {
  int X = 0, w = 0;
  char ch = 0;
  while (!isdigit(ch)) w |= ch == '-', ch = getchar();
  while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
  return w ? -X : X;
}
int main() {
  int n = read();
  string str[4];
  str[0] = "AC";
  str[1] = "WA";
  str[2] = "TLE";
  str[3] = "RE";
  int da[4];
  da[0] = da[1] = da[2] = da[3] = 0;
  while (n--) {
    string inp;
    cin >> inp;
    for (int i = 0; i < 4; i++) {
      if (str[i] == inp) da[i]++;
    }
  }
  for (int i = 0; i < 4; i++) {
    cout << str[i] << " * " << da[i] << endl;
  }
  return 0;
}
