#include <bits/stdc++.h>
using namespace std;
struct Room {
  int* a;
  int shortest;
  int way;
  int ways;
};
int main() {
  int N, a = 0, b = 0, c = 0, d = 0;
  static char szBuf[10] = {0};
  cin >> N;
  for (int x = 0; x < N; x++) {
    cin >> szBuf;
    if (!strcmp(szBuf, "AC")) a++;
    if (!strcmp(szBuf, "WA")) b++;
    if (!strcmp(szBuf, "TLE")) c++;
    if (!strcmp(szBuf, "RE")) d++;
  }
  cout << "AC x " << a << endl
       << "WA x " << b << endl
       << "TLE x " << c << endl
       << "RE x " << d << endl;
  return 0;
}
