#include <bits/stdc++.h>
using namespace std;
void c_p_c() {}
void solve() {
  long long n;
  cin >> n;
  long long ac = 0, wa = 0, tle = 0, re = 0;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC")
      ac++;
    else if (s == "WA")
      wa++;
    else if (s == "TLE")
      tle++;
    else if (s == "RE")
      re++;
  }
  cout << "AC"
       << " "
       << "*"
       << " " << ac << "\n";
  cout << "WA"
       << " "
       << "*"
       << " " << wa << "\n";
  cout << "TLE"
       << " "
       << "*"
       << " " << tle << "\n";
  cout << "RE"
       << " "
       << "*"
       << " " << re << "\n";
}
int32_t main() {
  c_p_c();
  solve();
}
