#include <bits/stdc++.h>
int main(void) {
  int N;
  scanf("%d", &N);
  int i, j;
  char s[10000];
  int C0, C1, C2, C3;
  C0 = 0;
  C1 = 0;
  C2 = 0;
  C3 = 0;
  for (j = 0; j < N; j++) {
    for (i = 0; i < 10000; i++)
      if (s[i] == '\0') {
        break;
      }
    scanf("%s", &s);
    if (s[0] == 'A' && s[1] == 'C') {
      C0 = C0 + 1;
    } else if (s[0] == 'W' && s[1] == 'A') {
      C1 = C1 + 1;
    } else if (s[0] == 'T' && s[1] == 'L' && s[2] == 'E') {
      C2 = C2 + 1;
    } else if (s[0] == 'R' && s[1] == 'E') {
      C3 = C3 + 1;
    }
  }
  printf("AC�@�~�@%d\nWA�@�~�@%d\nTLE�@�~�@%d\nRE�@�~�@%d\n", C0, C1, C2, C3);
  return 0;
}
