#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, a, b, c;
  string s;
  cin >> t;
  while (t--) {
    cin >> n;
    cin >> a >> b >> c;
    cin >> s;
    string ans;
    bool Fill[n];
    memset(Fill, false, sizeof(Fill));
    ans.resize(n);
    int numOfBeats = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == 'R' && b > 0) {
        ans[i] = 'P';
        b--;
        numOfBeats++;
        Fill[i] = true;
      } else if (s[i] == 'P' && c > 0) {
        ans[i] = 'S';
        c--;
        numOfBeats++;
        Fill[i] = true;
      } else if (s[i] == 'S' && a > 0) {
        ans[i] = 'R';
        a--;
        numOfBeats++;
        Fill[i] = true;
      }
    }
    if (numOfBeats < ceil(n / 2.0)) {
      cout << "NO" << endl;
      continue;
    } else {
      cout << "YES" << endl;
      for (int i = 0; i < n; i++) {
        if (!Fill[i]) {
          if (a > 0) {
            a--;
            ans[i] = 'R';
          } else if (b > 0) {
            b--;
            ans[i] = 'P';
          } else if (c > 0) {
            c--;
            ans[i] = 'S';
          }
        }
      }
      cout << ans << endl;
    }
  }
  return 0;
}
