#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  set<string> S;
  S.insert("AC");
  S.insert("WA");
  S.insert("TLE");
  S.insert("RE");
  string R;
  map<string, int> P;
  while (t--) {
    cin >> R;
    P[R]++;
  }
  for (auto x : S) {
    cout << x << " x " << P[x] << endl;
  }
}
