#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  cin >> N;
  int ac = 0;
  int wa = 0;
  int tle = 0;
  int re = 0;
  for (int i = 0; i < N; i++) {
    string aa;
    cin >> aa;
    if (aa == "AC") ac++;
    if (aa == "WA") wa++;
    if (aa == "TLE") tle++;
    if (aa == "RE") re++;
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "ATLE x " << tle << endl;
  cout << "RE x " << re << endl;
  return 0;
}
