#include <bits/stdc++.h>
using namespace std;
long long int P = 1000000007;
long long int MAX = 1e15;
long long int MIN = -1 * (1e15);
long long int a[3020], f[3020];
void solve() {
  long long int n, i, j, k, l, m, o, q, r, t;
  cin >> n;
  map<string, long long int> mp;
  for (i = 0; i < n; i++) {
    string s;
    cin >> s;
    mp[s]++;
  }
  cout << "AC * " << mp["AC"] << endl;
  cout << "WA * " << mp["WA"] << endl;
  cout << "TLE * " << mp["TLE"] << endl;
  cout << "RE * " << mp["RE"] << endl;
}
int main() {
  long long int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
