#include <bits/stdc++.h>
int main(void) {
  char mozi[10];
  int N, i;
  int AC = 0, WA = 0, TLE = 0, RE = 0;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%s", mozi);
    if (!(strcmp(mozi, "AC")))
      AC++;
    else if (!(strcmp(mozi, "WA")))
      WA++;
    else if (!(strcmp(mozi, "TLE")))
      TLE++;
    else if (!(strcmp(mozi, "RE")))
      RE++;
  }
  printf("ACx%d\nWAx%d\nTLEx%d\nREx%d", AC, WA, TLE, RE);
  return 0;
}
