#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string str;
  scanf("%d", &n);
  getchar();
  int A, W, T, R;
  A = W = T = R = 0;
  for (int i = 0; i < n; i++) {
    cin >> str;
    if (str == "AC")
      A++;
    else if (str == "WA")
      W++;
    else if (str == "TLE")
      T++;
    else if (str == "RTE")
      R++;
  }
  printf("AC x %d\n", A);
  printf("WA x %d\n", W);
  printf("TLE x %d\n", T);
  printf("RTE x %d\n", R);
  return 0;
}
