#include <bits/stdc++.h>
int main() {
  char s[1000][100];
  int n, i;
  int ans[5] = {0};
  scanf("%d", &n);
  for (i = 0; i < n; ++i) {
    scanf("%s", s[i]);
    switch (s[i][0]) {
      case 'A':
        ans[0]++;
        break;
      case 'W':
        ans[1]++;
        break;
      case 'T':
        ans[2]++;
        break;
      case 'R':
        ans[3]++;
        break;
      default:
        break;
    }
  }
  printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", ans[0], ans[1], ans[2],
         ans[3]);
  return 0;
}
