#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  std::cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  std::cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
long long int solve() {
  long long int n;
  cin >> n;
  long long int a, w, t, r;
  a = 0;
  w = 0;
  t = 0;
  r = 0;
  for (long long int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s[0] == 'A') {
      a++;
    } else if (s[0] == 'W') {
      w++;
    } else if (s[0] == 'T') {
      t++;
    } else {
      r++;
    }
  }
  cout << "AC X " << a << "\n"
       << "WA X " << w << "\n"
       << "TLE X " << t << "\n"
       << "RE X " << r << "\n";
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
