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