#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, ac = 0, wa = 0, tle = 0, re = 0;
  string s;
  cin >> n;
  while (n--) {
    cin >> s;
    if (s == "AC")
      ac++;
    else if (s == "WA")
      wa++;
    else if (s == "TLE")
      tle++;
    else if (s == "RA")
      re++;
  }
  cout << "AC x " << ac << endl
       << "WA x " << wa << endl
       << "TLE x " << tle << endl
       << "RE x " << re << endl;
  return 0;
}
