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