#include <bits/stdc++.h>
using namespace std;
int main() {
  long int N, i, ac = 0, wa = 0, tle = 0, re = 0;
  char word[10];
  cin >> N;
  for (i = 0; i < N; i++) {
    cin.get(*word);
    cin.ignore(80, '\n');
    if (!strcmp(word, "AC")) {
      ac++;
    }
    if (!strcmp(word, "WA")) {
      wa++;
    }
    if (!strcmp(word, "TLE")) {
      tle++;
    }
    if (!strcmp(word, "RE")) {
      re++;
    }
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
}
