#include <bits/stdc++.h>
using namespace std;
long long int mod = 1e9 + 7;
int main() {
  long long int t = 1;
  while (t--) {
    long long int n, i, j;
    cin >> n;
    map<string, int> mp;
    for (i = 0; i < n; i++) {
      string s;
      cin >> s;
      auto it = mp.find(s);
      if (it == mp.end()) {
        mp[s] = 1;
      } else {
        mp[s]++;
      }
    }
    int ac, wa, tle, re;
    string AC = "AC";
    auto it = mp.find(AC);
    if (it == mp.end()) {
      ac = 0;
    } else {
      ac = it->second;
    }
    string WA = "WA";
    it = mp.find(WA);
    if (it == mp.end()) {
      wa = 0;
    } else {
      wa = it->second;
    }
    string TLE = "TLE";
    it = mp.find(TLE);
    if (it == mp.end()) {
      tle = 0;
    } else {
      tle = it->second;
    }
    string RE = "RE";
    it = mp.find(RE);
    if (it == mp.end()) {
      re = 0;
    } else {
      re = it->second;
    }
    cout << AC << " * " << ac << '\n';
    cout << WA << " * " << wa << '\n';
    cout << TLE << " * " << tle << '\n';
    cout << RE << " * " << re << '\n';
  }
  return 0;
}
