#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  char s[6];
  int AC = 0, WA = 0, TLE = 0, RE = 0;
  for (int i = 0; i < n; i++) {
    scanf("%s", &s);
    if (s[0] == 'A') {
      AC++;
    } else if (s[i] == 'W') {
      WA++;
    } else if (s[i] == 'T') {
      TLE++;
    } else if (s[i] == 'R') {
      RE++;
    }
  }
  printf("AC x %d\n", AC);
  printf("WA x %d\n", WA);
  printf("TLE x %d\n", TLE);
  printf("RE x %d\n", RE);
  return 0;
}
