#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-7;
const long long mod = 1000000007;
const long long N = 998244353;
long long binpow(long long b, long long p) {
  long long ans = 1;
  while (p > 0) {
    if (p & 1) ans = (ans * b) % mod;
    b = (b * b) % mod;
    p >>= 1;
  }
  return ans;
}
long long modinv(long long x) { return binpow(x, mod - 2); }
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, i, a = 0, w = 0, t = 0, r = 0;
  cin >> n;
  string s;
  for (i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC")
      a++;
    else if (s == "WA")
      w++;
    else if (s == "TLE")
      t++;
    else
      r++;
  }
  cout << "AC * " << a << "\n";
  cout << "WA * " << w << "\n";
  cout << "TLE * " << t << "\n";
  cout << "RE * " << r << "\n";
}
