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