#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << " " << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
void inp_out() {}
long long int dpx[8] = {1, 1, 1, -1, -1, -1, 0, 0};
long long int dpy[8] = {-1, 1, 0, 1, -1, 0, -1, 1};
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  inp_out();
  long long int n;
  cin >> n;
  string s;
  long long int a = 0, b = 0, c = 0, d = 0;
  for (long long int i = 0; i < n; ++i) {
    cin >> s;
    if (s == "AC")
      ++a;
    else if (s == "WA")
      ++b;
    else if (s == "TLE")
      ++c;
    else
      ++d;
  }
  cout << "AC X " << a << "\n";
  cout << "WA X " << b << "\n";
  cout << "TLE X " << c << "\n";
  cout << "RE X " << d << "\n";
  return 0;
}
