#include <bits/stdc++.h>
using namespace std;
void compute(int n, int a, int b, int c, string s) {
  int need = n / 2;
  if (n % 2 == 1) need++;
  string seq = "";
  int rCount = 0;
  int pCount = 0;
  int sCount = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == 'R') {
      rCount++;
      if (rCount > b)
        seq += "O";
      else
        seq += "P";
    }
    if (s.at(i) == 'P') {
      pCount++;
      if (pCount > c)
        seq += "O";
      else
        seq += "S";
    }
    if (s.at(i) == 'S') {
      sCount++;
      if (sCount > a)
        seq += "O";
      else
        seq += "R";
    }
  }
  int rSucc;
  int pSucc;
  int sSucc;
  if (rCount > b) {
    pSucc = b;
  } else {
    pSucc = rCount;
  }
  if (pCount > c) {
    sSucc = c;
  } else {
    sSucc = pCount;
  }
  if (sCount > a) {
    rSucc = a;
  } else {
    rSucc = sCount;
  }
  need -= rSucc;
  need -= sSucc;
  need -= pSucc;
  if (need > 0) {
    cout << "NO" << endl;
    return;
  } else {
    cout << "YES" << endl;
  }
  for (int i = 0; i < n; i++) {
    if (seq.at(i) == 'O') {
      if (b > rCount) {
        seq.at(i) = 'P';
        rCount++;
      } else if (c > pCount) {
        seq.at(i) = 'S';
        pCount++;
      } else if (a > sCount) {
        seq.at(i) = 'R';
        sCount++;
      }
    }
  }
  cout << seq << endl;
}
int main() {
  int t;
  cin >> t;
  int n[t];
  int a[t];
  int b[t];
  int c[t];
  string s[t];
  for (int i = 0; i < t; i++) {
    cin >> n[i];
    cin >> a[i];
    cin >> b[i];
    cin >> c[i];
    cin >> s[i];
  }
  for (int i = 0; i < t; i++) {
    compute(n[i], a[i], b[i], c[i], s[i]);
  }
  return 0;
}
