#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int s[4] = {0, 0, 0, 0};
  string st;
  for (int i = 0; i < n; ++i) {
    cin >> st;
    if (st == "AC")
      s[0]++;
    else if (st == "WA")
      s[1]++;
    else if (st == "TLE")
      s[2]++;
    else if (st == "RE")
      s[3]++;
  }
  printf("AC X %d \nWA X %d \nTLE X %d \nRE X %d \n", s[0], s[1], s[2], s[3]);
  return 0;
}
