#include <bits/stdc++.h>
int main(void) {
  int N, ac = 0, wa = 0, tle = 0, re = 0;
  char ans[4];
  scanf("%d", &N);
  while (N--) {
    scanf("%s", ans);
    if ('A' == ans[0]) ac++;
    if ('W' == ans[0]) wa++;
    if ('T' == ans[0]) tle++;
    if ('R' == ans[0]) re++;
  }
  printf("AC x %d", ac);
  printf("WA x %d", wa);
  printf("TLE x %d", tle);
  printf("RE x %d", re);
}
