#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  string S;
  long long ac = 0, wa = 0, tle = 0, re = 0;
  for (long long i = 0; i < N; i++) {
    cin >> S;
    if (S == "AC") ac++;
    if (S == "WA") wa++;
    if (S == "TLE") tle++;
    if (S == "RE") re++;
  }
  cout << "ac x " << ac << endl
       << "wa x " << wa << endl
       << "tle x " << tle << endl
       << "re x " << re << endl;
}
