#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n, a, b, c, d;
  char str[5];
  scanf("%d", &n);
  a = 0;
  b = 0;
  c = 0;
  d = 0;
  for (i = 1; i <= n; i++) {
    scanf("%s", str);
    if (str[0] == 'A') {
      a++;
    } else if (str[0] == 'W') {
      b++;
    } else if (str[0] == 'T') {
      c++;
    } else if (str[0] == 'R') {
      d++;
    }
  }
  printf("AC x %d\n", a);
  printf("WA x %d\n", b);
  printf("TLE x %d\n", c);
  printf("Re x %d\n", d);
  return 0;
}
