#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> A(n);
  for (int i = 0; i < n; i++) {
    cin >> A.at(i);
  }
  int c0 = 0, c1 = 0, c2 = 0, c3 = 0;
  for (int i = 0; i < n; i++) {
    if (A.at(i) == "AC") {
      c0++;
    } else if (A.at(i) == "WA") {
      c1++;
    } else if (A.at(i) == "TLE") {
      c2++;
    } else if (A.at(i) == "RE") {
      c3++;
    }
  }
  cout << "AC X " << c0 << endl;
  cout << "WA X " << c1 << endl;
  cout << "TLE X " << c2 << endl;
  cout << "RE X " << c3 << endl;
}
