#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, ac = 0, tle = 0, wa = 0, re = 0;
  char s[10];
  cin >> n;
  while (n--) {
    cin >> s;
    if (strcmp(s, "AC") == 0)
      ac++;
    else if (strcmp(s, "RE") == 0)
      re++;
    else if (strcmp(s, "WA") == 0)
      wa++;
    else
      tle++;
  }
  cout << "AC X " << ac << endl;
  cout << "WA X " << wa << endl;
  cout << "TLE X " << tle << endl;
  cout << "RE X " << re << endl;
}
