#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  {
    long long int n;
    cin >> n;
    map<string, long long int> mpp;
    string str;
    for (long long int i = 0; i < n; i++) {
      cin >> str;
      mpp[str]++;
    }
    cout << "AC * " << mpp["AC"] << "\n";
    cout << "WA * " << mpp["WA"] << "\n";
    cout << "TLE * " << mpp["TLE"] << "\n";
    cout << "RE * " << mpp["RE"] << "\n";
  }
}
