#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  vector<string> vec;
  for (int i = 0; i < t; i++) {
    string x;
    cin >> x;
    vec.push_back(x);
  }
  string a = "AC ", b = "TLE ", d = "WA ", e = "RE ";
  int a1 = 0, b1 = 0, d1 = 0, e1 = 0;
  for (int i = 0; i < vec.size(); i++) {
    if (vec[i] == a) {
      a1++;
    }
    if (vec[i] == b) {
      b1++;
    }
    if (vec[i] == d) {
      d1++;
    }
    if (vec[i] == e) {
      e1++;
    }
  }
  cout << a << " x " << a1 << endl;
  cout << d << " x " << d1 << endl;
  cout << b << " x " << b1 << endl;
  cout << e << " x " << e1 << endl;
  return 0;
}
