#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string str;
  map<string, int> mp1 = {{"AC", 0}, {"WA", 0}, {"TLE", 0}, {"RE", 0}};
  map<string, int>::iterator itr1;
  cin >> N;
  while (N--) {
    cin >> str;
    itr1 = mp1.find(str);
    itr1->second++;
  }
  for (itr1 = mp1.begin(); itr1 != mp1.end(); ++itr1) {
    cout << itr1->first << " X " << itr1->second << endl;
  }
  return 0;
}
