#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int ac_count = 0, wa_count = 0, tle_count = 0, re_count = 0;
  string a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a == "AC")
      ac_count++;
    else if (a == "WA")
      wa_count++;
    else if (a == "TLE")
      tle_count++;
    else
      re_count++;
  }
  cout << "AC"
       << " * " << ac_count << '\n';
  cout << "WA"
       << " * " << wa_count << '\n';
  cout << "TLE"
       << " * " << tle_count << '\n';
  cout << "RE"
       << " * " << re_count << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cerr.tie(nullptr);
  int t = 1;
  while (t--) {
    solve();
  }
}
