#include <bits/stdc++.h>
using namespace std;
int max(int a, int b) {
  if (a > b)
    return a;
  else
    return b;
}
int min(int a, int b) {
  if (a > b)
    return b;
  else
    return a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, l;
  cin >> n;
  int a = 0, w = 0, t = 0, r = 0;
  while (n--) {
    string s;
    cin >> s;
    if (s[0] == 'A')
      a++;
    else if (s[0] == 'W')
      w++;
    else if (s[0] == 'T')
      t++;
    else
      r++;
  }
  cout << "AC X " << a << "\nWA X " << w << "\nTLE X " << t << "\nRE X " << r;
}
