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