#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int a[4] = {0}, n, i;
  cin >> n;
  while (n--) {
    cin >> s;
    if (s == "AC")
      a[0]++;
    else if (s == "WA")
      a[1]++;
    else if (s == "TLE")
      a[2]++;
    else
      a[3]++;
  }
  string c[4] = {"AC", "WA", "TLE", "RE"};
  for (i = 0; i < 4; i++) {
    cout << c[i] << " X " << a[i] << endl;
  }
}
