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