#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
int main() {
  int n;
  cin >> n;
  vector<int> v(4, 0);
  string str;
  for (int i = 0; i < n; i++) {
    cin >> str;
    if (str == "AC") v.at(0)++;
    if (str == "WA") v.at(1)++;
    if (str == "TLE") v.at(2)++;
    if (str == "RE") v.at(3)++;
  }
  cout << "AC * " << v.at(0) << endl;
  cout << "WA * " << v.at(1) << endl;
  cout << "TLE * " << v.at(2) << endl;
  cout << "RE * " << v.at(3) << endl;
  return 0;
}
