#include <bits/stdc++.h>
using namespace std;
long long fast_exp(long long base, long long exp) {
  long long res = 1;
  while (exp > 0) {
    if (exp % 2 == 1) res = (res * base) % 1000000007;
    base = (base * base) % 1000000007;
    exp /= 2;
  }
  return res % 1000000007;
}
long long fib(long long n) {
  if (n < 2) return n;
  long long a = 0, b = 1, pre;
  int i = 1;
  while (i < n) {
    pre = (a + b) % 1000000007;
    a = b;
    b = pre;
    i++;
  }
  return pre;
}
long long fac(long long n) {
  if (n % 2 == 0) return 2;
  for (long long i = 3; i * i <= n; i += 2) {
    if (n % i == 0) return i;
  }
  return n;
}
long long fact(long long n) {
  if (n > 1)
    return n * fact(n - 1);
  else
    return 1;
}
bool sortbysec(const tuple<int, int, int> &a, const tuple<int, int, int> &b) {
  return (get<1>(a) < get<1>(b));
}
int main() {
  map<string, int> make_pair;
  int n;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    make_pair[s]++;
  }
  cout << "AC X " << make_pair["AC"] << "\n";
  cout << "WA X " << make_pair["WA"] << "\n";
  cout << "TLE X " << make_pair["TLE"] << "\n";
  cout << "RE X " << make_pair["RE"] << "\n";
}
