#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<string> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  int A = 0;
  int B = 0;
  int C = 0;
  int D = 0;
  for (int i = 0; i < N; i++) {
    if (vec.at(i) == "AC") {
      A++;
    }
    if (vec.at(i) == "WA") {
      B++;
    }
    if (vec.at(i) == "TLE") {
      C++;
    }
    if (vec.at(i) == "RE") {
      D++;
    }
  }
  cout << "ACx" << A << endl;
  cout << "WAx" << B << endl;
  cout << "TLEx" << C << endl;
  cout << "REx" << D << endl;
}
