#include <bits/stdc++.h>
int main() {
  int x, cnt = 0, cnt1 = 0, cnt2 = 0, cnt3 = 0;
  char str1[] = "AC", str2[] = "TLE", str3[] = "WA", str4[] = "RE";
  char ch[5];
  scanf("%d", &x);
  while (x--) {
    scanf("%s", ch);
    if (strcmp(str1, ch) == 0)
      cnt++;
    else if (strcmp(str2, ch) == 0)
      cnt1++;
    else if (strcmp(str3, ch) == 0)
      cnt2++;
    else if (strcmp(str4, ch) == 0)
      cnt3++;
  }
  printf("AC * %d\n", cnt);
  printf("WA * %d\n", cnt1);
  printf("TLE * %d\n", cnt2);
  printf("RE * %d\n", cnt3);
  return 0;
}
