#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, sum, x, y, z, n, t, b, c, d, m, k, w;
  string s;
  x = 0;
  y = 0;
  z = 0;
  w = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC") w = w + 1;
    if (s == "WA") x = x + 1;
    if (s == "TLE") y = y + 1;
  }
  z = n - x - y - w;
  cout << "AC * " << w << "\n";
  cout << "WA * " << x << "\n";
  cout << "TLE * " << y << "\n";
  cout << "RE * " << z;
  return 0;
}
