#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int ac, wa, tle, re;
  for (int i = 0; i < n; i++) {
    string temp;
    cin >> temp;
    if (temp == "AC") ac++;
    continue;
    if (temp == "WA") wa++;
    continue;
    if (temp == "TLE") tle++;
    continue;
    if (temp == "RE") re++;
    continue;
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
  return 0;
}
