#include <bits/stdc++.h>
int main() {
  int m, i, c0 = 0, c1 = 0, c2 = 0, c3 = 0;
  char string[4];
  scanf("%d", &m);
  for (i = 0; i <= m; i++) {
    gets(string);
    if (string[0] == 'A' && string[1] == 'C')
      c0 = c0 + 1;
    else if (string[0] == 'W' && string[1] == 'A')
      c1 = c1 + 1;
    else if (string[0] == 'T' && string[1] == 'L' && string[2] == 'E')
      c2 = c2 + 1;
    else if (string[0] == 'R' && string[1] == 'E')
      c3 = c3 + 1;
    else
      ;
  }
  printf("ACx%d\nWAx%d\nTLEx%d\nREx%d", c0, c1, c2, c3);
  return 0;
}
