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