#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9 + 7;
const int MAXN = 2 * 1e5 + 10;
int main() {
  int n;
  cin >> n;
  int W = 0, A = 0, T = 0, R = 0;
  for (int i = 0; i < n; ++i) {
    string t;
    cin >> t;
    if (t == "AC") {
      ++A;
    } else if (t == "WA") {
      ++W;
    } else if (t == "TLE") {
      ++T;
    } else {
      ++R;
    }
  }
  cout << "AC * " << A << endl;
  cout << "WA * " << W << endl;
  cout << "TLE * " << T << endl;
  cout << "RTE * " << R << endl;
  return 0;
}
