#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, c0, c1, c2, c3;
  c0 = 0;
  c1 = 0;
  c2 = 0;
  c3 = 0;
  cin >> n;
  vector<string> v(n);
  for (long long int i = 0; i < n; i++) {
    cin >> v[i];
    if (v[i] == "AC") {
      c0++;
    } else if (v[i] == "WA") {
      c1++;
    } else if (v[i] == "TLE") {
      c2++;
    }
  }
  cout << "AC * " << c0 << endl;
  cout << "WA * " << c1 << endl;
  cout << "TLE * " << c2 << endl;
  cout << "RE * " << n - c0 - c1 - c2 << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
