#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int n;
  cin >> n;
  string s;
  vector<int> ans(4, 0);
  for (int i = 0; i < (int)(n); i++) {
    cin >> s;
    if (s == "AC") ans[0]++;
    if (s == "WA") ans[1]++;
    if (s == "TLE") ans[2]++;
    if (s == "RE") ans[3]++;
  }
  cout << "AC x " << ans[0] << endl;
  cout << "RE x " << ans[1] << endl;
  cout << "TLE x " << ans[2] << endl;
  cout << "RE x " << ans[3] << endl;
  return 0;
}
