#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string *a = new string[N];
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  int AC = 0, WA = 0, TLE = 0, RE = 0;
  for (int i = 0; i < N; i++) {
    if (a[i] == "AC") {
      AC++;
    } else if (a[i] == "WA") {
      WA++;
    } else if (a[i] == "TLE") {
      TLE++;
    } else {
      RE++;
    }
  }
  cout << "AC * " << AC << endl;
  cout << "WA * " << WA << endl;
  cout << "TLE * " << TLE << endl;
  cout << "RE * " << RE << endl;
  delete[] a;
  return 0;
}
