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