#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
template <typename T>
T pow(T a, T b, long long m) {
  T ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = (ans * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return ans % m;
}
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first > b.first);
}
int main() {
  long long n, i, a = 0, b = 0, c = 0, d = 0;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    if (s == "AC") {
      a++;
    } else {
      if (s == "WA") {
        b++;
      } else {
        if (s == "TLE") {
          c++;
        } else {
          d++;
        }
      }
    }
  }
  cout << "AC * " << a << "\n"
       << "WA * " << b << "\n"
       << "TLE * " << c << "\n"
       << "RE * " << d << "\n";
  return 0;
}
