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