#include <bits/stdc++.h>
int main() {
  int i, c0, c1, c2, c3, N;
  char S[3];
  c0 = c1 = c2 = c3 = 0;
  scanf("%d", &N);
  for (i = 0; i < N; ++i) {
    scanf("%s", S);
    printf("%s", S);
    if (strcmp(S, "AC") == 0) {
      c0 += 1;
    } else if (strcmp(S, "WA") == 0) {
      c1 += 1;
    } else if (strcmp(S, "TLE") == 0) {
      c2 += 1;
    } else {
      c3 += 1;
    }
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", c0, c1, c2, c3);
}
