#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a = 0, b = 0, c = 0, d = 0;
  scanf("%lld", &n);
  string s;
  while (n--) {
    cin >> s;
    if (s == "AC")
      a++;
    else if (s == "WA")
      b++;
    else if (s == "TLE")
      c++;
    else
      d++;
  }
  printf("AC X %lld\n", a);
  printf("WA X %lld\n", b);
  printf("TLE X %lld\n", c);
  printf("RE X %lld\n", d);
}
