#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c0 = 0, c1 = 0, c2 = 0, c3 = 0;
  cin >> n;
  char s[7];
  while (n--) {
    cin >> s;
    if (strcmp("AC", s) == 0)
      c0++;
    else if (strcmp("WA", s) == 0)
      c1++;
    else if (strcmp("TLE", s) == 0)
      c2++;
    else
      c3++;
  }
  cout << "AC * " << c0 << endl;
  cout << "WA * " << c1 << endl;
  cout << "TLE * " << c2 << endl;
  cout << "RE * " << c3 << endl;
}
