#include <bits/stdc++.h>
int main(void) {
  int N;
  int i1 = 0;
  int i2 = 0;
  int i3 = 0;
  int i4 = 0;
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    char str[3];
    scanf("%s", str);
    if (strcmp("AC", str) == 0) {
      i1++;
      printf("%d\n", i1);
    } else if (strcmp("WA", str) == 0) {
      i2++;
      printf("%d\n", i2);
    } else if (strcmp("TLE", str) == 0) {
      i3++;
      printf("%d\n", i3);
    } else if (strcmp("RE", str) == 0) {
      i4++;
      printf("%d\n", i4);
    }
  }
  printf("AC x %d\n", i1);
  printf("WA x %d\n", i2);
  printf("TLE x %d\n", i3);
  printf("RE x %d\n", i4);
  return 0;
}
