#include <bits/stdc++.h>
using namespace std;
long long binsearch(long long x, vector<long long> v) {
  long long l = 0, r = v.size() - 1, mid, ans = 0;
  while (l <= r) {
    mid = (l + r) / 2;
    if (v[mid] < x)
      l = mid + 1, ans = mid;
    else if (v[mid] > x)
      r = mid - 1;
    else
      return mid;
  }
  return ans;
}
int main() {
  long long n;
  cin >> n;
  map<string, int> mp;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    mp[s]++;
  }
  cout << "AC X " << mp["AC"] << endl;
  cout << "WA X " << mp["WA"] << endl;
  cout << "TLE X " << mp["TLE"] << endl;
  cout << "RE X " << mp["RE"] << endl;
}
