#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int ctr = 0;
  int c0 = 0, c1 = 0, c2 = 0, c3 = 0;
  char input[6];
  do {
    cin >> input;
    ctr++;
    if (strcmp(input, "AC") == 0) {
      c0++;
    } else if (strcmp(input, "WA") == 0) {
      c1++;
    } else if (strcmp(input, "TLE") == 0) {
      c2++;
    } else if (strcmp(input, "RE") == 0) {
      c3++;
    }
  } while (ctr < N);
  cout << "AC X " << c0 << endl;
  cout << "WA X " << c1 << endl;
  cout << "TLE X " << c2 << endl;
  cout << "RE X " << c3 << endl;
  return 0;
}
