#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  unordered_map<string, int> m;
  while (t--) {
    string s;
    cin >> s;
    m[s]++;
  }
  cout << "AC*" << m["AC"] << endl;
  cout << "WA*" << m["WA"] << endl;
  cout << "TLE*" << m["TLE"] << endl;
  cout << "RE*" << m["RE"] << endl;
}
