#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
long long mul(long long a, long long b) {
  return ((a % mod) * (b % mod)) % mod;
}
long long power(long long a, long long b) {
  long long z = 1;
  long long x = a;
  while (b > 0) {
    if (b & 1) z = mul(z, x);
    x = mul(x, x);
    b >>= 1;
  }
  return z;
}
int main() {
  int n;
  cin >> n;
  map<string, int> m;
  m["AC"] = 0, m["WA"] = 0, m["TLE"] = 0, m["RE"] = 0;
  while (n--) {
    string s;
    cin >> s;
    m[s]++;
  }
  cout << "AC"
       << "*" << m["AC"] << endl;
  cout << "WA"
       << "*" << m["WA"] << endl;
  cout << "TLE"
       << "*" << m["TLE"] << endl;
  cout << "RE"
       << "*" << m["RE"] << endl;
}
