#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, ac = 0, wa = 0, tle = 0, re = 0;
  string st;
  cin >> t;
  vector<string> str;
  for (int i = 0; i < t; i++) {
    cin >> st;
    str.push_back(st);
  }
  for (int i = 0; i < str.size(); i++) {
    if (str[i] == "AC") {
      ac++;
    } else if (str[i] == "WA") {
      wa++;
    } else if (str[i] == "TLE") {
      tle++;
    } else {
      re++;
    }
  }
  cout << "AC"
       << " * " << ac << "\n"
       << "WA"
       << " * " << wa << "\n"
       << "TLE"
       << " * " << tle << "\n"
       << "RE"
       << " * " << re << "\n";
}
