#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, s1 = 0, s2 = 0, s3 = 0, s4 = 0;
  string s;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC") {
      s1++;
    }
    if (s == "WA") {
      s2++;
    }
    if (s == "TLE") {
      s3++;
    }
    if (s == "RE") {
      s4++;
    }
  }
  cout << "AC * " << s1 << "\n";
  cout << "WA * " << s2 << "\n";
  cout << "TLE * " << s3 << "\n";
  cout << "RE * " << s4 << "\n";
  return 0;
}
