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