#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  int ac = 0, tle = 0, wa = 0, re = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC")
      ac++;
    else if (s == "WA")
      wa++;
    else if (s == "TLE")
      tle++;
    else
      re++;
  }
  cout << "AC "
       << "* " << ac << "\n";
  cout << "WA "
       << "* " << wa << "\n";
  cout << "TLE "
       << "* " << tle << "\n";
  cout << "RE "
       << "* " << re << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(NULL);
  ;
  int t = 1;
  while (t--) solve();
}
