#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, i = 0, ac = 0, wa = 0, tle = 0, re = 0;
  cin >> n;
  string s[n];
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
  }
  for (int i = 0; i < n; ++i) {
    if (s[i] == "AC") {
      ac++;
    } else if (s[i] == "TLE") {
      tle++;
    } else if (s[i] == "RE") {
      re++;
    } else {
      wa++;
    }
  }
  cout << "AC"
       << " "
       << "*"
       << " " << ac << "\n";
  cout << "WA"
       << " "
       << "*"
       << " " << wa << "\n";
  cout << "TLE"
       << " "
       << "*"
       << " " << tle << "\n";
  cout << "RE"
       << " "
       << "*"
       << " " << re << "\n";
  return 0;
}
