#include <bits/stdc++.h>
using namespace std;
int main() {
  int AC = 0, WA = 0, TLE = 0, RE = 0, N = 1;
  vector<string> S(10000);
  for (int i = 0; i < N + 1; i++) {
    if (i == 0) {
      int X;
      cin >> X;
      N = X;
    } else {
      cin >> S.at(i);
      if (S.at(i) == "AC") {
        AC = AC++;
      } else if (S.at(i) == "WA") {
        WA = WA++;
      } else if (S.at(i) == "TLE") {
        TLE = TLE++;
      } else if (S.at(i) == "RE") {
        RE = RE++;
      }
    }
  }
  cout << "ACx" << AC << endl;
  cout << "WAx" << WA << endl;
  cout << "TLEx" << TLE << endl;
  cout << "REx" << RE << endl;
}
