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