#include <bits/stdc++.h>
#pragma target("avx")
#pragma optimize("O3")
#pragma optimize("unroll-loops")
constexpr double eps = 1e-9;
constexpr double pi = 3.141592653589793238462643383279;
using namespace std;
long long gcd(long long a, long long b) {
  if (a % b == 0)
    return (b);
  else
    return (gcd(b, a % b));
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long pow(long long x, long long n) {
  x %= 998244353;
  if (n == 0) return 1;
  if (n % 2 == 0)
    return (pow((x * x) % 998244353, n / 2) % 998244353);
  else
    return (x * pow(x, n - 1)) % 998244353;
}
int main() {
  int n;
  cin >> n;
  vector<string> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  int ac = 0;
  int wa = 0;
  int tle = 0;
  int re = 0;
  for (long long i = 0; i < n; i++) {
    if (a[i] == "AC") ac++;
    if (a[i] == "WA") wa++;
    if (a[i] == "TLE") tle++;
    if (a[i] == "RE") re++;
  }
  cout << "AC x" << ac << endl;
  cout << "WA x" << wa << endl;
  cout << "TLE x" << tle << endl;
  cout << "RE x" << re << endl;
}
