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