#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long int ac_count = 0, wa_count = 0, tle_count = 0, re_count = 0;
  int N;
  string result;
  cin >> N;
  while (N--) {
    cin >> result;
    if (result == "AC") ac_count++;
    if (result == "WA") wa_count++;
    if (result == "TLE") tle_count++;
    if (result == "re") re_count++;
  }
  cout << "AC x " << ac_count << endl;
  cout << "WA x " << wa_count << endl;
  cout << "TLE x " << tle_count << endl;
  cout << "RE x " << re_count << endl;
  return 0;
}
