#include <bits/stdc++.h>
using namespace std;
void c_p_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  c_p_c();
  int n;
  cin >> n;
  string str[n];
  int ac = 0, tle = 0, wa = 0, re = 0;
  for (int i = 0; i < n; i++) cin >> str[i];
  for (int i = 0; i < n; i++) {
    if (str[i] == "AC")
      ac++;
    else if (str[i] == "TLE")
      tle++;
    else if (str[i] == "WA")
      wa++;
    else if (str[i] == "RE")
      re++;
  }
  cout << "AC X " << ac << endl;
  cout << "WA X " << wa << endl;
  cout << "TLE X " << tle << endl;
  cout << "RE X " << re << endl;
  return 0;
}
