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