#include <bits/stdc++.h>
using namespace std;
bool sortinrev1(const pair<int, int>& a, const pair<int, int>& b) {
  if (a.first == b.first)
    return (a.second > b.second);
  else
    return (a.first > b.first);
}
bool sortinrev2(const pair<int, int>& a, const pair<int, int>& b) {
  if (a.first == b.first)
    return (a.second < b.second);
  else
    return (a.first > b.first);
}
int main() {
  int n;
  string str;
  map<string, int> mp;
  cin >> n;
  getchar();
  while (n--) {
    cin >> str;
    mp[str]++;
  }
  cout << "AC X " << mp["AC"] << endl;
  cout << "WA X " << mp["WA"] << endl;
  cout << "TLE X " << mp["TLE"] << endl;
  cout << "RE X " << mp["RE"] << endl;
}
