#include <bits/stdc++.h>
using namespace std;
map<string, long long> q;
long long n;
string s;
signed main() {
  scanf("%lld", &n);
  for (long long i = 1; i <= n; i++) {
    cin >> s;
    q[s]++;
  }
  printf("AC X %lld\n", q["AC"]);
  printf("WA X %lld\n", q["WA"]);
  printf("TLE X %lld\n", q["TLE"]);
  printf("RE X %lld\n", q["RE"]);
  return 0;
}
