#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  string s[n];
  long long int i, ca = 0, ct = 0, cr = 0, cw = 0;
  for (i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i][0] == 'A')
      ca++;
    else if (s[i][0] == 'R')
      cr++;
    else if (s[i][0] == 'T')
      ct++;
    else
      cw++;
  }
  cout << "AC"
       << " X " << ca << '\n';
  cout << "WA"
       << " X " << cw << '\n';
  cout << "TLE"
       << " X " << ct << '\n';
  cout << "RE"
       << " X " << cr << '\n';
}
