#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int a, b, ac = 0, wa = 0, tle = 0, re = 0;
  cin >> a;
  while (a--) {
    string aa;
    cin >> aa;
    if (aa == "AC") {
      ac++;
    } else if (aa == "WA") {
      wa++;
    } else if (aa == "TLE") {
      tle++;
    } else if (aa == "RE") {
      re++;
    }
  }
  cout << "AC X " << ac << "\n";
  cout << "WA X " << wa << "\n";
  cout << "TLE X " << tle << "\n";
  cout << "RE X " << re;
  return 0;
}
