#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0;
  bool f = false;
  char c = getchar();
  while (!isdigit(c)) f |= c == '-', c = getchar();
  while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  return f ? ~x + 1 : x;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n = read();
  int ac = 0, wa = 0, tle = 0, re = 0;
  for (register int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    if (s == "AC") {
      ++ac;
    } else if (s == "WA") {
      ++wa;
    } else if (s == "TLE") {
      ++tle;
    } else {
      ++re;
    }
  }
  printf("AC x %d\nWA x %d\nTLE x %d\n RE x %d", ac, wa, tle, re);
}
