#include <bits/stdc++.h>
using namespace std;
void __start__() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
mt19937_64 rnd(time(0));
using ll = long long;
using vi = vector<long long>;
using ld = long double;
using vb = vector<bool>;
using pii = pair<long long, long long>;
using vd = vector<long double>;
long long log2(long long q) {
  long long c = 0;
  while (q) {
    q >>= 1;
    c++;
  }
  return c;
}
void test_case() {
  long long n, a, b, c, d;
  cin >> n;
  a = b = c = d = 0;
  for (long long i = 0; i < n; ++i) {
    string s;
    cin >> s;
    if (s == "AC") a++;
    if (s == "WA") b++;
    if (s == "TLE") c++;
    if (s == "RE") d++;
  }
  cout << "AC x" << a << '\n';
  cout << "WA x" << b << '\n';
  cout << "TLE x" << c << '\n';
  cout << "RE x" << d << '\n';
}
signed main() {
  __start__();
  long long Q = 1;
  while (Q--) {
    test_case();
  }
}
