#include <bits/stdc++.h>
using namespace std;
int main() {
  int tt;
  int a, w, t, r;
  cin >> tt;
  a = w = t = r = 0;
  while (tt--) {
    string c;
    cin >> c;
    if (c == "AC") {
      a++;
    } else if (c == "WA") {
      w++;
    } else if (c == "TLE") {
      t++;
    } else {
      r++;
    }
  }
  printf("AC x %d\nWA x %d\nTLE X %d\nRE x %d\n", a, w, t, r);
}
