#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, i, j, a, b, c, d;
  char s[1000000];
  scanf("%d", &n);
  a = 0;
  b = 0;
  c = 0;
  d = 0;
  for (i = 0; i < n; i++) {
    scanf("%s", s);
    if (s[0] == 'A') {
      a += 1;
    } else if (s[0] == 'W') {
      b += 1;
    } else if (s[0] == 'T') {
      c += 1;
    } else {
      d += 1;
    }
  }
  printf("AC x %d\n", a);
  printf("WA x %d\n", b);
  printf("TEL x %d\n", c);
  printf("RE x %d\n", d);
  return 0;
}
