#include <bits/stdc++.h>
using namespace std;
long long begtime = clock();
long long tttt;
template <typename Arg1>
void splitx(string s, char c, vector<string> &v) {
  long long i = 0, j;
  while (i < (long long)(s).size()) {
    j = i;
    string temp;
    while (j < (long long)(s).size() && s[j] != c) {
      temp += s[j];
      j++;
    }
    v.push_back(temp);
    i = j + 1;
  }
}
struct TreeNode {
  long long val;
  TreeNode *left;
  TreeNode *right;
  TreeNode(long long x) : val(x), left(NULL), right(NULL) {}
};
signed main() {
  long long n;
  cin >> n;
  map<string, long long> m;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    m[s]++;
  }
  cout << "AC X " << m["AC"] << '\n';
  cout << "WA X " << m["WA"] << '\n';
  cout << "TLE X " << m["TLE"] << '\n';
  cout << "RE X " << m["RE"] << '\n';
  return 0;
}
