#include <bits/stdc++.h>
using namespace std;
int main() {
  int ac = 0, wa = 0, tle = 0, re = 0;
  int n, i;
  string s;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> s;
    if (s == "AC") ac++;
    if (s == "WA") wa++;
    if (s == "TLE") tle++;
    if (s == "RE") re++;
  }
  cout << "AC x " << ac;
  cout << "WA x " << wa;
  cout << "TLE x " << tle;
  cout << "RE x " << re;
  return 0;
}
