#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string res;
  map<string, int> result = {{"AC", 0}, {"WA", 0}, {"TLE", 0}, {"RE", 0}};
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> res;
    result[res]++;
  }
  cout << "AC x" << result["AC"] << "\n";
  cout << "WA x" << result["WA"] << "\n";
  cout << "TLE x" << result["TLE"] << "\n";
  cout << "RE x" << result["RE"] << "\n";
}
