#include <bits/stdc++.h>
int main(void) {
  int N;
  int i;
  int index[4] = {0, 0, 0, 0};
  scanf("%d", &N);
  char s[N][5];
  for (i = 0; i < N; i++) {
    scanf("%S", &s[i][0]);
  }
  for (i = 0; i < N; i++) {
    if (s[i][0] == 'A')
      index[0]++;
    else if (s[i][0] == 'W')
      index[1]++;
    else if (s[i][0] == 'T')
      index[2]++;
    else
      index[3]++;
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", index[0], index[1], index[2],
         index[3]);
  return 0;
}
