#include <bits/stdc++.h>
using namespace std;
void solve() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int r, p, s;
    cin >> r >> p >> s;
    string q;
    cin >> q;
    int lastn = ceil(n / 2.0);
    int R = 0, P = 0, S = 0;
    for (long long i = 0; i < q.size(); i++) {
      if (q[i] == 'R') {
        R++;
      } else if (q[i] == 'S') {
        S++;
      } else {
        P++;
      }
    }
    int total = min(R, p) + min(P, s) + min(S, r);
    if (total < lastn) {
      cout << "NO" << endl;
      ;
      continue;
    } else {
      char ans[q.size()];
      memset(ans, '0', sizeof(ans));
      for (int i = 0; i < q.size(); i++) {
        if (q[i] == 'S') {
          if (r > 0) {
            ans[i] = 'R';
            r--;
          }
        } else if (q[i] == 'R') {
          if (p > 0) {
            ans[i] = 'P';
            p--;
          }
        } else {
          if (s > 0) {
            ans[i] = 'S';
            s--;
          }
        }
      }
      for (int i = 0; i < q.size(); i++) {
        if (ans[i] == '0') {
          if (r > 0) {
            ans[i] = 'R';
            r--;
          } else if (p > 0) {
            ans[i] = 'P';
            p--;
          } else if (s > 0) {
            ans[i] = 'S';
            s--;
          }
        }
      }
      cout << "YES" << endl;
      ;
      for (int i = 0; i < q.size(); i++) {
        cout << ans[i];
      }
      cout << endl;
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
