#include <bits/stdc++.h>
using namespace std;
const long long N = 1000010;
long long dx[] = {0, 0, 1, -1, 1, 1, -1, -1},
          dy[] = {1, -1, 0, 0, 1, -1, 1, -1};
inline long long read() {
  long long first = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' || ch <= '9') {
    first = (first << 1) + (first << 3) + (ch ^ 48);
    ch = getchar();
  }
  return first * f;
}
long long ac, tle, re, wa;
void print() {
  printf("AC X %d\n", ac);
  printf("WA X %d\n", wa);
  printf("TLE X %d\n", tle);
  printf("RE X %d\n", re);
}
void solve() {
  string s;
  cin >> s;
  if (s == "AC") ac++;
  if (s == "TLE") tle++;
  if (s == "RE") re++;
  if (s == "WA") wa++;
}
signed main() {
  long long _;
  cin >> _;
  while (_--) solve();
  print();
  return 0;
}
