#include <bits/stdc++.h>
const int INF = 1111111111;
const double EPS = 1e-9;
using namespace std;
void init() {}
void solve() {
  int n;
  cin >> n;
  int ac, tle, wa, re = 0;
  for (int i = (0); i < (int)(n); i++) {
    string s;
    cin >> s;
    if (s == "AC") {
      ac++;
      continue;
    }
    if (s == "WA") {
      wa++;
      continue;
    }
    if (s == "TLE") {
      tle++;
      continue;
    }
    if (s == "RE") {
      re++;
      continue;
    }
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
}
int main() {
  init();
  solve();
}
