#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int p = 0, q = 0, r = 0, t = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") p++;
    if (s == "TLE") q++;
    if (s == "WA") r++;
    if (s == "RE") t++;
  }
  cout << "AC * " << p << endl;
  cout << "WA * " << r << endl;
  cout << "TLE * " << q << endl;
  cout << "RE * " << t << endl;
}
