#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> s(n);
  for (int i = 0; i < n; i++) {
    cin >> s.at(i);
  }
  int c_0 = 0, c_1 = 0, c_2 = 0, c_3 = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == "AC") c_0++;
    if (s.at(i) == "WA") c_1++;
    if (s.at(i) == "TLE") c_2++;
    if (s.at(i) == "RE") c_3++;
  }
  cout << "AC * " << c_0 << endl;
  cout << " WA * " << c_1 << endl;
  cout << "TLE * " << c_2 << endl;
  cout << "RE * " << c_3 << endl;
}
