#include <bits/stdc++.h>
int main() {
  int ac, wa, tle, re, n, temp;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", &temp);
    if (temp = 'AC') {
      ac++;
    }
    if (temp = 'WA') {
      wa++;
    }
    if (temp = 'TLE') {
      tle++;
    }
    if (temp = 'RE') {
      re++;
    }
  }
  printf("AC x %d\nWA x %d\nTLE x %d\n RE x %d\n", ac, wa, tle, re);
}
