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