#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using Graph = vector<vector<long long>>;
long long fg(long long k) {
  long long sum = 1;
  for (long long i = 1; i <= k; ++i) {
    sum *= i;
  }
  return sum;
}
signed main() {
  long long a;
  cin >> a;
  vector<string> p(a);
  for (long long i = 0; i < a; i++) {
    cin >> p[i];
  }
  vector<long long> q(4);
  for (long long j = 0; j < a; j++) {
    if (p[j] == "AC") {
      q[0]++;
    } else if (p[j] == "WA") {
      q[1]++;
    } else if (p[j] == "TLE") {
      q[2]++;
    } else if (p[j] == "RE") {
      q[3]++;
    }
  }
  cout << "AC X " << q[0] << endl;
  cout << "WA X " << q[1] << endl;
  cout << "TLE X " << q[2] << endl;
  cout << "RE X " << q[3];
}
