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