#include <bits/stdc++.h>
#pragma GCC optimize("-O2")
using namespace std;
const int LIM = 2e5 + 5, MOD = 1e9 + 7;
int t, n, m, k, x, y;
int findMex(map<int, int> make_pair) {
  int i = 0;
  while (make_pair[i]) i++;
  return i;
}
int main() {
  int n;
  cin >> n;
  int ac = 0, wa = 0, tle = 0, re = 0;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC")
      ac++;
    else if (s == "WA")
      wa++;
    else if (s == "TLE")
      tle++;
    else if (s == "RE")
      re++;
  }
  cout << "AC * " << ac << endl;
  cout << "WA * " << wa << endl;
  cout << "TLE * " << tle << endl;
  cout << "RE * " << re << endl;
}
