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