#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, w, t, r;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") {
      a++;
    } else if (s == "WA") {
      w++;
    } else if (s == "TLE") {
      t++;
    } else {
      r++;
    }
  }
  cout << "AC * " << a;
  cout << "WA * " << w;
  cout << "TLE * " << t;
  cout << "RE * " << r;
  return 0;
}
