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