#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string ans[N];
  for (int i = 0; i < N; i++) cin >> ans[i];
  int count_ac, count_wa, count_tle, count_re;
  count_ac = 0;
  count_wa = 0;
  count_tle = 0;
  count_re = 0;
  for (int i = 0; i < N; i++) {
    if (ans[i] == "AC") {
      count_ac++;
    } else if (ans[i] == "WA") {
      count_wa++;
    } else if (ans[i] == "TLE") {
      count_tle++;
    } else {
      count_re++;
    }
  }
  cout << "AC"
       << "x" << count_ac << endl;
  cout << "WA"
       << "x" << count_wa << endl;
  cout << "TLE"
       << "x" << count_tle << endl;
  cout << "RE"
       << "x" << count_re << endl;
  return 0;
}
