#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  long long int a = 0, b = 0, c = 0, d = 0;
  std::vector<string> v;
  for (long long int i = 0; i < n; ++i) {
    string second;
    cin >> second;
    v.push_back(second);
  }
  for (int i = 0; i < v.size(); ++i) {
    if (v[i] == "AC")
      a++;
    else if (v[i] == "WA")
      b++;
    else if (v[i] == "TLE")
      c++;
    else if (v[i] == "RE")
      d++;
  }
  cout << "AC * " << a << "\n";
  cout << "WA * " << b << "\n";
  cout << "TLE * " << c << "\n";
  cout << "RE * " << d << "\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
