#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));
  while (n--) {
    string s;
    cin >> s;
    m[s]++;
  }
  for (map<string, int>::iterator i = m.begin(); i != m.end(); i++) {
    cout << i->first << " x " << i->second << endl;
  }
}
