#include <bits/stdc++.h>
int main(void) {
  int n;
  int counta = 0, countw = 0, countt = 0, countr = 0;
  char s[10000][3];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  for (int i = 0; i < n; i++) {
    if (s[i][0] == 'A')
      counta++;
    else if (s[i][0] == 'W')
      countw++;
    else if (s[i][0] == 'T')
      countt++;
    else if (s[i][0] == 'R')
      countr++;
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", counta, countw, countt,
         countr);
  return 0;
}
