#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, i, j, k;
  cin >> n;
  vector<pair<string, int> > v(4);
  v[0].first = "AC";
  v[1].first = "WA";
  v[2].first = "TLE";
  v[3].first = "RE";
  for (i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AC") {
      v[0].second++;
    } else if (s == "WA") {
      v[1].second++;
    } else if (s == "TLE") {
      v[2].second++;
    } else {
      v[3].second++;
    }
  }
  for (i = 0; i < v.size(); i++) {
    cout << v[i].first << " X " << v[i].second << endl;
  }
}
