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