#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int t;
  cin >> t;
  map<string, int> mp;
  while (t--) {
    string str;
    cin >> str;
    mp[str]++;
  }
  cout << "AC * " << mp["AC"] << endl;
  cout << "WA * " << mp["WA"] << endl;
  cout << "TLE * " << mp["TLE"] << endl;
  cout << "RE * " << mp["RE"] << endl;
}
