#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a = 0, w = 0, t = 0, r = 0;
  scanf("%d", &n);
  char s[4];
  for (int i = 0; i < n; i++) {
    scanf("%s", &s);
    if (s == "AC") {
      a++;
    } else if (s == "WA") {
      w++;
    } else if (s == "TLE") {
      t++;
    } else if (s == "RE") {
      r++;
    }
  }
  printf("AC x %d\n", a);
  printf("WA x %d\n", w);
  printf("TLE x %d\n", t);
  printf("RE x %d\n", r);
  return 0;
}
