#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long T = 1;
  while (T--) {
    map<string, long long> mp;
    long long N;
    cin >> N;
    for (long long i = 0; i < N; ++i) {
      string t;
      cin >> t;
      mp[t]++;
    }
    cout << "AC * " << mp["AC"] << endl;
    cout << "WA * " << mp["WA"] << endl;
    cout << "TLE * " << mp["TLE"] << endl;
    cout << "RE * " << mp["RE"] << endl;
  }
}
