#include <bits/stdc++.h>
using namespace std;
void change(vector<string> &st, int n) {
  int a = 0, w = 0, t = 0, r = 0;
  for (int i = 0; i < n; i++) {
    if (st[i] == "AC") {
      a++;
    }
    if (st[i] == "WA") {
      w++;
    }
    if (st[i] == "TLE") {
      t++;
    }
    if (st[i] == "RE") {
      r++;
    }
  }
  cout << "AC X " << a << endl;
  cout << "WA X " << w << endl;
  cout << "TLE X " << t << endl;
  cout << "RE X " << r << endl;
}
int main() {
  int n;
  cin >> n;
  vector<string> st;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    st.push_back(s);
  }
  change(st, n);
}
