#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  long long int ac, wa, tle, re;
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    string str;
    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 << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
