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