#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  char ch[5];
  int a[4] = {0};
  for (int i = 0; i < n; i++) {
    cin >> ch;
    char k = ch[0];
    if (k == 'A')
      a[0]++;
    else if (k == 'W')
      a[1]++;
    else if (k == 'T')
      a[2]++;
    else
      a[3]++;
  }
  cout << "AC X " << a[0];
  cout << "\nWA X " << a[1];
  cout << "\nTLE X " << a[2];
  cout << "\nRE X " << a[3];
  return 0;
}
