#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long int n;
  cin >> n;
  ;
  char s[70];
  long long int ac = 0, wa = 0, tle = 0, re = 0;
  for (long long int i = 0; i < n; ++i) {
    cin >> s;
    if (s[0] == 'A') {
      ac++;
    } else if (s[0] == 'W') {
      wa++;
    } else if (s[0] == 'T') {
      tle++;
    } else if (s[0] == 'R') {
      re++;
    }
  }
  cout << "AC X " << ac << "\n";
  cout << "WA X " << wa << "\n";
  cout << "TLE X " << tle << "\n";
  cout << "RE X " << re << "\n";
  return 0;
}
