#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  string s;
  long long a = 0, b = 0, c = 0, d = 0;
  for (long long i = 0; i < n; i++) {
    cin >> s;
    if (s[0] == 'A') {
      a++;
    }
    if (s[0] == 'W') {
      b++;
    }
    if (s[0] == 'T') {
      c++;
    }
    if (s[0] == 'R') {
      d++;
    }
  }
  cout << "AC X " << a << endl;
  cout << "WA X " << b << endl;
  cout << "TLE X " << c << endl;
  cout << "RE X " << d << endl;
}
