#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
const long long INF = 1LL << 60;
using vll = vector<long long>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using vc = vector<char>;
using vvc = vector<vc>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
long long dx[4] = {0, 1, 0, -1};
long long dy[4] = {1, 0, -1, 0};
int main() {
  map<string, long long> p;
  p["AC"] = 0;
  p["WA"] = 0;
  p["TLE"] = 0;
  p["RE"] = 0;
  long long n;
  cin >> n;
  for (long long i = 0; i < (n); i++) {
    string s;
    cin >> s;
    p[s]++;
  }
  cout << "AC X " << p["AC"] << endl;
  cout << "WA X " << p["WA"] << endl;
  cout << "TLE X " << p["TLE"] << endl;
  cout << "RE X " << p["RE"] << endl;
}
