#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int ac = 0, w = 0, t = 0, r = 0;
  while (n--) {
    string s;
    cin >> s;
    if (s[0] == 'A') {
      ac++;
    } else if (s[0] == 'W') {
      w++;
    } else if (s[0] == 'T') {
      t++;
    } else {
      r++;
    }
  }
  cout << "AC"
       << " X " << ac << endl;
  cout << "WA"
       << " X " << w << endl;
  cout << "TLE"
       << " X " << t << endl;
  cout << "RE"
       << " X " << r << endl;
}
