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