#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string a[n];
  int countac = 0, countwa = 0, counttle = 0, countre = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    cout << a[i] << endl;
    if (a[i] == "AC") {
      countac++;
    } else if (a[i] == "WA") {
      countwa++;
    } else if (a[i] == "TLE") {
      counttle++;
    } else if (a[i] == "RE") {
      countre++;
    }
  }
  cout << "AC"
       << " * " << countac << endl;
  cout << "WA"
       << " * " << countwa << endl;
  cout << "TLE"
       << " * " << counttle << endl;
  cout << "RE"
       << " * " << countre << endl;
}
