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