#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
template <typename T>
T flip(T val) {
  reverse(begin(val), end(val));
  return val;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    long long n;
    cin >> n;
    map<string, long long> mp;
    mp["AC"] = 0;
    mp["WE"] = 0;
    mp["TLE"] = 0;
    mp["RE"] = 0;
    for (int64_t i = 0; i < n; i++) {
      string str;
      cin >> str;
      mp[str]++;
    }
    cout << "AC X " << mp["AC"] << "\n";
    cout << "WA X " << mp["WA"] << "\n";
    cout << "TLE X " << mp["TLE"] << "\n";
    cout << "RE X " << mp["RE"] << "\n";
  }
}
