#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  map<string, long long int> s;
  while (n--) {
    string x;
    cin >> x;
    s[x]++;
  }
  cout << "AC * " << s["AC"] << "\n";
  cout << "WA * " << s["WA"] << "\n";
  cout << "TLE * " << s["TLE"] << "\n";
  cout << "RE * " << s["RE"] << "\n";
}
