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