#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string s(0);
  int a(0), w(0), t(0), r(0);
  for (int i = 0; i < N; i++) {
    cin >> s[i];
    if (s[i] == 'A') {
      a++;
    } else if (s[i] == 'W') {
      w++;
    } else if (s[i] == 'T') {
      t++;
    } else if (s[i] == 'R') {
      r++;
    }
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << w << endl;
  cout << "TLE x " << t << endl;
  cout << "RE x " << r << endl;
  return 0;
}
