#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int ac_counter = 0;
  int wa_counter = 0;
  int tle_counter = 0;
  int re_counter = 0;
  cin >> N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  for (int i = 0; i < N; i++) {
    if (vec.at(i) == 'AC') {
      ac_counter = +1;
    }
    if (vec.at(i) == 'WA') {
      wa_counter = +1;
    }
    if (vec.at(i) == 'TLE') {
      tle_counter = +1;
    }
    if (vec.at(i) == 'RE') {
      re_counter = +1;
    }
  }
  cout << 'AC x ' + ac_counter << endl;
  cout << 'WA x ' + wa_counter << endl;
  cout << 'TLE x ' + tle_counter << endl;
  cout << 'RE x ' + re_counter << endl;
}
