#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  string s;
  int ac = 0, tle = 0, wa = 0, re = 0;
  for (int i = 0; i < t; i++) {
    cin >> s;
    if (s[0] == 'A' && s[1] == 'C') {
      ac++;
    }
    if (s[0] == 'W' && s[1] == 'A') {
      wa++;
    }
    if (s[0] == 'T' && s[1] == 'L' && s[2] == 'E') {
      tle++;
    }
    if (s[0] == 'R' && s[1] == 'E') {
      re++;
    }
  }
  cout << "AC x " << ac << endl;
  cout << "WC x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
}
