#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, a = 0, w = 0, t = 0, r = 0;
  char s[10001];
  cin >> n;
  for (i = 0; i < n; i++) {
    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 << endl << " WA X " << w << endl;
  cout << " TLE X " << t << endl << " RE X " << r << endl;
  return 0;
}
