#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  int c = 0, c1 = 0, c2 = 0, c3 = 0;
  string s[100000];
  cin >> t;
  for (int i = 0; i < t; ++i) {
    cin >> s[i];
    if (s[i] == "AC") c++;
    if (s[i] == "WA") c1++;
    if (s[i] == "TLE") c2++;
    if (s[i] == "RE") c3++;
  }
  cout << "AC * " << c << endl;
  cout << "WA * " << c1 << endl;
  cout << "TLE * " << c2 << endl;
  cout << "RE * " << c3 << endl;
}
