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