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