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