#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<pair<string, int>> var{{"AC", 0}, {"WA", 0}, {"TLE", 0}, {"RE", 0}};
  int n;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    auto it = find_if(var.begin(), var.end(), [&s](const pair<string, int>& p) {
      return p.first == s;
    });
    (*it).second++;
  }
  auto itr = var.begin();
  for (; itr != var.end(); itr++) {
    cout << (*itr).first << " X " << (*itr).second << endl;
  }
}
