#include <bits/stdc++.h>
int main() {
  long long int n;
  int ac = 0;
  int wa = 0;
  int tle = 0;
  int re = 0;
  scanf("%lld", &n);
  for (int i = 0; i < n; i++) {
    char testing[4];
    scanf("%s", &testing);
    if (testing[0] = 'A') {
      ac++;
    } else if (testing[0] = 'W') {
      wa++;
    } else if (testing[0] = 'T') {
      tle++;
    } else if (testing[0] = 'R') {
      re++;
    }
  }
  printf("AC x %d\n", ac);
  printf("WA x %d\n", wa);
  printf("TLE x %d\n", tle);
  printf("RE x %d\n", re);
  return 0;
}
