#include <bits/stdc++.h>
using namespace std;
int keta(int n) {
  int res;
  for (int i = 0; i < 100; i++) {
    n = n / 10;
    if (n == 0) {
      res = i + 1;
      break;
    }
  }
  return res;
}
int main() {
  int n;
  int wa = 0, ac = 0, re = 0, tle = 0;
  cin >> n;
  for (int i = 0; i <= n; i++) {
    string s;
    cin >> s;
    if (s == "AC")
      ac++;
    else if (s == "WA")
      wa++;
    else if (s == "RE")
      re++;
    else if (s == "TLE")
      tle++;
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << endl;
}
