#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<string, int> make_pair;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    make_pair[s]++;
  }
  cout << "AC X " << make_pair["AC"] << endl;
  cout << "WA X " << make_pair["WA"] << endl;
  cout << "TLE X " << make_pair["TLE"] << endl;
  cout << "RE X " << make_pair["RE"] << endl;
}
