#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ac = 0, wa = 0, tle = 0, re = 0;
  string a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a == "ac") ac++;
    if (a == "wa") wa++;
    if (a == "tle") tle++;
    if (a == "re") re++;
  }
  cout << "AC x" << ac << endl;
  cout << "Wa x" << wa << endl;
  cout << "Tle x" << tle << endl;
  cout << "Re x " << re << endl;
}
