#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  string str;
  map<string, int> m;
  for (int i = 0; i < n; i++) {
    cin >> str;
    m[str]++;
  }
  cout << "AC * " << m["AC"] << "\n";
  cout << "WA * " << m["WA"] << "\n";
  cout << "TLE * " << m["TLE"] << "\n";
  cout << "RE * " << m["RE"] << "\n";
}
