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