#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ac = 0, wa = 0, re = 0, tle = 0;
  cin >> n;
  string str[n];
  for (int i = 0; i < n; i++) {
    cin >> str[i];
  }
  for (int i = 0; i < n; i++) {
    if (str[i] == "AC")
      ac++;
    else if (str[i] == "TLE")
      tle++;
    else if (str[i] == "WA")
      wa++;
    else if (str[i] == "RE")
      re;
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
}
