#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, c, d, e, f;
  cin >> a;
  vector<string> b(a);
  for (int i = 0; i < a; i++) {
    cin >> b.at(i);
  }
  for (int i = 0; i < a; i++) {
    if (b.at(i) == "AC") {
      c++;
    }
  }
  cout << "AC"
       << " x " << c << endl;
  for (int i = 0; i < a; i++) {
    if (b.at(i) == "WA") {
      d++;
    }
  }
  cout << "WA"
       << " x " << d << endl;
  for (int i = 0; i < a; i++) {
    if (b.at(i) == "TLE") {
      e++;
    }
  }
  cout << "TLE"
       << " x " << e << endl;
  for (int i = 0; i < a; i++) {
    if (b.at(i) == "RE") {
      f++;
    }
  }
  cout << "RE"
       << " x " << f << endl;
}
