#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> mp;
  map<string, int>::iterator it;
  int n, i;
  string s;
  cin >> n;
  mp.insert(make_pair("AC", 0));
  mp.insert(make_pair("WA", 0));
  mp.insert(make_pair("TLE", 0));
  mp.insert(make_pair("RE", 0));
  for (i = 0; i < n; i++) {
    cin >> s;
    mp[s]++;
  }
  for (it = mp.begin(); it != mp.end(); it++) {
    cout << it->first << " "
         << "X"
         << " " << it->second << endl;
  }
  return 0;
}
