#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string str;
  cin >> N >> str;
  int A = 0;
  int W = 0;
  int T = 0;
  int R = 0;
  for (int i = 0; i < str.size(); i++) {
    if (str.at(i) == 'C') {
      A++;
    }
    if (str.at(i) == 'W') {
      W++;
    }
    if (str.at(i) == 'T') {
      T++;
    }
    if (str.at(i) == 'R') {
      R++;
    }
  }
  cin >> A >> W >> T >> R;
  cout << "AC"
       << "x" << A << endl;
  cout << "WA"
       << "x" << W << endl;
  cout << "TLE"
       << "x" << T << endl;
  cout << "RE"
       << "x" << R << endl;
}
