#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y, long long int md) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) res = ((res % md) * (x % md)) % md;
    y = y >> 1;
    x = ((x % md) * (x % md)) % md;
  }
  return res % md;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  {
    long long int n, i;
    cin >> n;
    string s;
    map<string, long long int> mp;
    for (i = 0; i < n; 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;
}
