#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  for (int k = 0; k < q; k++) {
    int n;
    cin >> n;
    int a, b, c;
    cin >> a >> b >> c;
    string s;
    cin >> s;
    int pc = 0, sc = 0, rc = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == 'R') rc++;
      if (s[i] == 'P') pc++;
      if (s[i] == 'S') sc++;
    }
    int pw = min(rc, b);
    int sw = min(pc, c);
    int rw = min(sc, a);
    if (pw + sw + rw < (n + 1) / 2) {
      cout << "NO"
           << "\n";
      continue;
    }
    int pr = b - pw;
    int rr = a - rw;
    int sr = c - sw;
    cout << "YES"
         << "\n";
    bool get_rem = true;
    for (int i = 0; i < n; i++) {
      get_rem = true;
      if (s[i] == 'R' && pw) {
        cout << "P";
        pw--;
        get_rem = false;
      } else if (s[i] == 'P' && sw) {
        cout << "S";
        sw--;
        get_rem = false;
      } else if (s[i] == 'S' && rw) {
        cout << "R";
        rw--;
        get_rem = false;
      }
      if (get_rem) {
        if (pr) {
          cout << "P";
          pr--;
        } else if (rr) {
          cout << "R";
          rr--;
        } else if (sr) {
          cout << "S";
          sr--;
        }
      }
    }
    cout << "\n";
  }
}
