#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n, i;
  cin >> t;
  map<string, long long> use;
  string s;
  for (i = 0; i < t; i++) {
    cin >> s;
    use[s]++;
  }
  cout << "AC * " << use["AC"] << endl;
  cout << "WA * " << use["WA"] << endl;
  cout << "TLE * " << use["TLE"] << endl;
  cout << "RE * " << use["RE"] << endl;
}
