#include <bits/stdc++.h>
using namespace std;
void hike() {
  int64_t n;
  cin >> n;
  map<string, int64_t> hash;
  for (int64_t i = 0; i < n; ++i) {
    string s;
    cin >> s;
    hash[s]++;
  }
  cout << "AC x" << hash["AC"] << "\n";
  cout << "WA x" << hash["WA"] << "\n";
  cout << "TLE x" << hash["TLE"] << "\n";
  cout << "RE x" << hash["RE"] << "\n";
}
signed main() {
  int64_t t = 1;
  while (t--) hike();
  return 0;
}
