#include <bits/stdc++.h>
using namespace std;
int main() {
  clock_t begin, end;
  double time_spent;
  begin = clock();
  int n;
  cin >> n;
  int a = 0, b = 0, c = 0, d = 0;
  for (int i = 0; i < n; i++) {
    string st;
    cin >> st;
    if (st == "AC")
      a++;
    else if (st == "WA")
      b++;
    else if (st == "TLE")
      c++;
    else
      d++;
  }
  cout << "AC X " << a << "\n";
  cout << "WA X " << a << "\n";
  cout << "TLE X " << a << "\n";
  cout << "RE X " << a << "\n";
  end = clock();
  time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
  cerr << "Time spent = " << time_spent << endl;
  return 0;
}
