#include <bits/stdc++.h>
using namespace std;
long long po(long long a, long long x, long long m) {
  if (x == 0) {
    return 1;
  }
  long long ans = 1;
  long long k = 1;
  while (k <= x) {
    if (x & k) {
      ans = ((ans * a) % m);
    }
    k <<= 1;
    a *= a;
    a %= m;
  }
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  map<string, long long> ans;
  while (t--) {
    string s;
    cin >> s;
    ans[s]++;
  }
  cout << "AC X " << ans["AC"] << "\n";
  cout << "WA X " << ans["WA"] << "\n";
  cout << "TLE X " << ans["TLE"] << "\n";
  cout << "RE X " << ans["RE"] << "\n";
  return 0;
}
