#include <bits/stdc++.h>
using namespace std;
long long t, ac, we, re, tle;
string s;
int main() {
  cin >> t;
  while (t--) {
    cin >> s;
    if (s == "AC") {
      ac++;
    }
    if (s == "WE") {
      we++;
    }
    if (s == "RE") {
      re++;
    }
    if (s == "TLE") {
      tle++;
    }
  }
  cout << "AC x " << ac << endl;
  cout << "WE x " << we << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
}
