#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, k, a, b, c, n, t, m, p, q, d, e, f, x, y, g, z, h;
  long double aa, bb, cc, dd, ee, ff, kk, gg;
  string st, et, ft, pt, ct;
  cin >> n;
  c = 0;
  d = 0;
  e = 0;
  f = 0;
  for (i = 0; i < n; i++) {
    cin >> st;
    if (st[0] == 'A')
      c++;
    else if (st[0] == 'W')
      d++;
    else if (st[0] == 'T')
      f++;
    else
      e++;
  }
  cout << "AC * " << c << endl
       << "WA * " << d << endl
       << "TLE * " << f << endl
       << "RE * " << e << endl;
}
