#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  unordered_map<string, int> arr;
  arr.insert(make_pair("AC", 0));
  arr.insert(make_pair("WA", 0));
  arr.insert(make_pair("TLE", 0));
  arr.insert(make_pair("RE", 0));
  string a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    auto it = arr.find(a);
    it->second++;
  }
  cout << "AC"
       << " * " << arr["AC"] << endl;
  cout << "WA"
       << " * " << arr["WA"] << endl;
  cout << "TLE"
       << " * " << arr["TLE"] << endl;
  cout << "RE"
       << " * " << arr["RE"] << endl;
}
