#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> cnt = {{"AC", 0}, {"WA", 0}, {"TLE", 0}, {"RE", 0}};
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string tmp;
    cin >> tmp;
    cnt[tmp] += 1;
  }
  for (auto iter = cnt.begin(); iter != cnt.end(); iter++) {
    cout << iter->first << " x " << iter->second << endl;
  }
}
