#include <bits/stdc++.h>
int main() {
  int N, i, C0, C1, C2, C3;
  char S[100000];
  scanf("%d", &N);
  for (i = 1; i <= N; i++) {
    scanf("%s", &S[i]);
  }
  for (i = 1; i <= N; i++) {
    if (S[i] == 'AC')
      C0 = C0 + 1;
    else if (S[i] == 'WA')
      C1 = C1 + 1;
    else if (S[i] == 'TLE')
      C2 = C2 + 1;
    else
      C3 = C3 + 1;
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d", C0, C1, C2, C3);
  return 0;
}
