#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  vector<string> a;
  int b;
  string s;
  cin >> b;
  for (int i = 0; i < (int)(b); i++) {
    cin >> s;
    a.push_back(s);
  }
  cout << "ACx" << count(a.begin(), a.end(), "AC") << endl;
  cout << "WAx" << count(a.begin(), a.end(), "WA") << endl;
  cout << "TLEx" << count(a.begin(), a.end(), "TLE") << endl;
  cout << "REx" << count(a.begin(), a.end(), "RE") << endl;
  return 0;
}
