#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, r, ans;
  scanf("%lld", &n);
  string s;
  map<string, long long> tc;
  while (n--) {
    cin >> s;
    tc[s]++;
  }
  printf("AC X %lld\n", tc["AC"]);
  printf("WA X %lld\n", tc["WA"]);
  printf("TLE X %lld\n", tc["TLE"]);
  printf("RE X %lld\n", tc["RE"]);
}
