#include <bits/stdc++.h>
int main() {
  char S[3];
  int i, N;
  int c0, c1, c2, c3;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%s", S);
    if (S[0] == 'A')
      c0++;
    else if (S[0] == 'W')
      c1++;
    else if (S[0] == 'T')
      c2++;
    else
      c3++;
  }
  printf("AC x %d\n", c0);
  printf("WA x %d\n", c1);
  printf("TLE x %d\n", c2);
  printf("RE x %d\n", c3);
  return 0;
}
