#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
ll INF = 1ll << 60;
void chmin(int &a, int b) {
  if (a > b) a = b;
}
void chmax(int &a, int b) {
  if (a < b) a = b;
}
void llchmin(ll &a, ll b) {
  if (a > b) a = b;
}
void llchmax(ll &a, ll b) {
  if (a < b) a = b;
}
int main() {
  int n;
  cin >> n;
  int ac = 0, wa = 0, tle = 0, re = 0;
  for (int i = (int)(0); i < (int)(n); i++) {
    string s;
    cin >> s;
    if (s == "AC") ac++;
    if (s == "WA") wa++;
    if (s == "TLE") tle++;
    if (s == "re") re++;
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
  return 0;
}
