#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  scanf("%d", &n);
  int ac = 0, wa = 0, tle = 0, re = 0;
  for (i = 0; i < n; i++) {
    string temp;
    cin >> temp;
    if (temp == "AC") {
      ac++;
    } else if (temp == "WA") {
      wa++;
    } else if (temp == "TLE") {
      tle++;
    } else {
      re++;
    }
  }
  printf("AC * %d\n", ac);
  printf("WA * %d\n", wa);
  printf("TLE * %d\n", tle);
  printf("RE * %d\n", re);
}
