#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  string a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long int ac = 0, wa = 0, tle = 0, re = 0;
  for (long long int i = 0; i < n; i++) {
    if (a[i][0] == 'A')
      ac++;
    else if (a[i][0] == 'T')
      tle++;
    else if (a[i][0] == 'W')
      wa++;
    else if (a[i][0] == 'R')
      re++;
  }
  cout << "AC X " << ac << endl;
  cout << "WA X " << wa << endl;
  cout << "TLE X " << tle << endl;
  cout << "RE X " << re << endl;
}
int main() {
  long long int t = 1;
  while (t--) solve();
  return 0;
}
