#include <bits/stdc++.h>
using namespace std;
long long mod(long long a) {
  if (a > 0)
    return a;
  else
    return -a;
}
long long min(long long a, long long b) {
  if (a > b)
    return b;
  else
    return a;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long max(long long a, long long b) {
  if (a < b)
    return b;
  else
    return a;
}
int main() {
  long long max = 0, i1, n, n1, n2, i, w, j, l = 0, k = 0, c0 = 0, c1 = 0,
            c2 = 0, c3 = 0, m, t, gcd1;
  cin >> t;
  string s1, s2;
  for (i1 = 0; i1 < t; i1++) {
    cin >> s1;
    if (s1 == "TLE") c2++;
    if (s1 == "AC") c0++;
    if (s1 == "WA") c1++;
    if (s1 == "RE") c3++;
  }
  cout << "AC X " << c0 << endl
       << "WA X " << c1 << endl
       << "TLE X " << c2 << endl
       << "RE X " << c3;
  return 0;
}
