#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int ac = 0, tle = 0, wa = 0, re = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC")
      ac++;
    else if (s == "TLE")
      tle++;
    else if (s == "WA")
      wa++;
    else if (s == "RE")
      re++;
  }
  cout << "AC"
       << " " << '*' << " " << ac << endl;
  cout << "WA"
       << " " << '*' << " " << wa << endl;
  cout << "TLE"
       << " " << '*' << " " << tle << endl;
  cout << "RE"
       << " " << '*' << " " << re << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  t = 1;
  while (t--) solve();
  return 0;
}
