#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve() {
  ll n;
  cin >> n;
  map<string, ll> m;
  for (int i = 0; i < (n); ++i) {
    string s;
    cin >> s;
    m[s]++;
  }
  cout << "AC * " << m["AC"] << "\n";
  cout << "WA * " << m["WA"] << "\n";
  cout << "TLE * " << m["TLE"] << "\n";
  cout << "RE * " << m["RE"] << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
