#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  scanf("%d", &N);
  vector<string> S(N);
  for (int i = 0; i < N; i++) {
    cin >> S.at(i);
  }
  int ac = 0;
  int wa = 0;
  int tle = 0;
  int re = 0;
  for (int j = 0; j < N; j++) {
    if (S.at(j) == "AC") {
      ac++;
    } else if (S.at(j) == "WA") {
      wa++;
    } else if (S.at(j) == "TLE") {
      tle++;
    } else if (S.at(j) == "re") {
      re++;
    }
  }
  printf("AC x %d\n", ac);
  printf("WA x %d\n", wa);
  printf("TLE x %d\n", tle);
  printf("RE x %d\n", re);
}
