#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
int main(void) {
  int n = 0;
  char c = getchar_unlocked();
  while (c <= '9' && c >= '0') {
    n = (n << 1) + (n << 3) + c - '0';
    c = getchar_unlocked();
  }
  int a = 0, b = 0, e = 0, d = 0;
  while (--n) {
    switch (getchar_unlocked()) {
      case 'A':
        ++a;
        break;
      case 'W':
        ++b;
        break;
      case 'R':
        ++d;
        break;
      default:
        ++e;
        getchar_unlocked();
    }
    getchar_unlocked();
    getchar_unlocked();
  }
  switch (getchar_unlocked()) {
    case 'A':
      ++a;
      break;
    case 'W':
      ++b;
      break;
    case 'R':
      ++d;
      break;
    default:
      ++e;
  }
  printf("C x %d\nWA x %d\nTLE x %d\nRE x %d", a, b, e, d);
  return 0;
}
