#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, w, a, t, r, i;
  t = r = a = w = 0;
  cin >> n;
  char s[10000][4];
  for (i = 0; i < n; i++) {
    scanf("%s", s[i]);
    if (s[i][0] == 'A') {
      a++;
    } else if (s[i][0] == 'W') {
      w++;
    } else if (s[i][0] == 'T') {
      t++;
    } else {
      r++;
    }
  }
  printf("AC x %d\n", a);
  printf("WA x %d\n", w);
  printf("TLE x %d\n", t);
  printf("RE x %d\n", r);
}
