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