#include <bits/stdc++.h>
const double PI = acos(-1);
using namespace std;
void solve() {
  int N, i;
  cin >> N;
  map<unsigned char, int> look;
  look['A'] = 0;
  look['W'] = 0;
  look['T'] = 0;
  look['R'] = 0;
  for (i = 0; i < N; i += 1) {
    string x;
    cin >> x;
    look[x[0]] += 1;
  }
  cout << "AC X " << look['A'] << endl;
  cout << "WA X " << look['W'] << endl;
  cout << "TLE X " << look['T'] << endl;
  cout << "RE X " << look['R'];
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
