#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y,
                    long long int p = (long long int)(1e13)) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
const long long int N = 1e5 + 2;
long long int n, a[N], k;
struct cmp {
  bool operator()(const long long int &a, const long long int &b) {
    return a > b;
  }
};
void solve() {
  long long int n;
  cin >> n;
  string ac = "AC", tle = "TLE", wa = "WA", re = "RE";
  long long int a = 0, t = 0, w = 0, r = 0;
  string s;
  for (long long int i = 0; i < n; i++) {
    cin >> s;
    if (s == ac) {
      ++a;
    } else if (s == tle) {
      ++t;
    } else if (s == wa) {
      ++w;
    } else {
      ++r;
    }
  }
  cout << ac << ' ' << a << '\n';
  cout << wa << ' ' << w << '\n';
  cout << tle << ' ' << t << '\n';
  cout << re << ' ' << r << '\n';
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  for (long long int i = 0; i < t; i++) solve();
  return 0;
}
