#include <bits/stdc++.h>
using namespace std;
void solve() {
  int64_t n, i;
  cin >> n;
  map<string, int64_t> f;
  for (i = 0; i < n; i++) {
    string str;
    cin >> str;
    f[str]++;
  }
  cout << "AC * " << f["AC"] << '\n';
  cout << "WA * " << f["WA"] << '\n';
  cout << "TLE * " << f["TLE"] << '\n';
  cout << "RE * " << f["RE"] << '\n';
}
signed main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  { solve(); }
  cerr << " Execution : " << (1.0 * clock()) / CLOCKS_PER_SEC << "s \n";
  return 0;
}
