#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
template <class T>
void out(T a) {
  cout << a << '\n';
}
template <class T>
void outp(T a) {
  cout << '(' << a.fi << ',' << a.se << ')' << '\n';
}
template <class T>
void outvp(T v) {
  for (int i = 0; i < v.size(); i++)
    cout << '(' << v[i].fi << ',' << v[i].se << ')';
  cout << '\n';
}
template <class T>
void outvvp(T v) {
  for (int i = 0; i < v.size(); i++) outvp(v[i]);
}
template <class T>
void outv(T v) {
  for (int i = 0; i < v.size(); i++) {
    if (i) cout << ' ';
    cout << v[i];
  }
  cout << '\n';
}
template <class T>
void outvv(T v) {
  for (int i = 0; i < v.size(); i++) outv(v[i]);
}
template <class T>
bool isin(T x, T l, T r) {
  return (l) <= (x) && (x) <= (r);
}
template <class T>
void yes(T b) {
  if (b)
    out("yes");
  else
    out("no");
}
template <class T>
void Yes(T b) {
  if (b)
    out("Yes");
  else
    out("No");
}
template <class T>
void YES(T b) {
  if (b)
    out("YES");
  else
    out("NO");
}
template <class T>
void no(T b) {
  if (b)
    out("no");
  else
    out("yes");
}
template <class T>
void No(T b) {
  if (b)
    out("No");
  else
    out("Yes");
}
template <class T>
void NO(T b) {
  if (b)
    out("NO");
  else
    out("YES");
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long modpow(long long a, long long b) {
  long long res = 1;
  a %= mod;
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
int main() {
  long long n;
  cin >> n;
  map<string, long long> m;
  m["AC"] = 0;
  m["RE"] = 0;
  m["WA"] = 0;
  m["TLE"] = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    m[s]++;
  }
  cout << "AC x " << m["AC"] << "\n";
  cout << "WA x " << m["WA"] << "\n";
  cout << "TLE x " << m["TRE"] << "\n";
  cout << "RE x " << m["RE"] << "\n";
}
