#include <bits/stdc++.h>
using namespace std;
const double pi = 3.141592653589793;
bool isprime(long long n) {
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
long long power(long long a, long long b) {
  long long ans = 1;
  while (b > 0) {
    if (b & 1) {
      ans = (ans * a);
    }
    b >>= 1;
    a = (a * a);
  }
  return ans;
}
void frooty() {
  long long n;
  cin >> n;
  string s;
  long long ac = 0, wa = 0, tle = 0, re = 0;
  for (long long i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC") {
      ac++;
    } else if (s == "WA") {
      wa++;
    } else if (s == "TLE") {
      tle++;
    } else
      re++;
  }
  cout << "AC X " << ac << "\n";
  cout << "WA X " << wa << "\n";
  cout << "TLE X " << tle << "\n";
  cout << "RE X " << re << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int q = 1;
  while (q--) {
    frooty();
  }
}
