#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  int tl = 0, wa = 0, ac = 0, re = 0;
  vector<string> v(t);
  for (int i = 0; i < t; i++) {
    cin >> v[i];
    if (v[i] == "TLE") tl++;
    if (v[i] == "AC") ac++;
    if (v[i] == "WA") wa++;
    if (v[i] == "RE") re++;
  }
  cout << "AC X " << ac << endl
       << "WA X " << wa << endl
       << "TLE X " << tl << endl
       << "RE X " << re << endl;
}
