#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  string s;
  unordered_map<string, long long int> m;
  while (n--) {
    cin >> s;
    m[s]++;
  }
  printf("AC * "), printf("%lld", m["AC"]), printf("\n");
  printf("WA * "), printf("%lld", m["WA"]), printf("\n");
  printf("TLE * "), printf("%lld", m["TLE"]), printf("\n");
  printf("RE * "), printf("%lld", m["RE"]), printf("\n");
  m.clear();
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  solve();
  return 0;
}
