#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  cin >> t;
  while (t--) {
    long long a, b, n = 0, c, win, rock = 0, sci = 0, pap = 0, sum = 0,
                    extr = 0, extp = 0, exts = 0;
    cin >> n;
    cin >> a >> b >> c;
    string str;
    cin >> str;
    vector<char> ans;
    if (n % 2 == 0)
      win = n / 2;
    else
      win = n / 2 + 1;
    for (long long i = 0; i < n; i++) {
      if (str[i] == 'P') pap++;
      if (str[i] == 'R') rock++;
      if (str[i] == 'S') sci++;
    }
    sum += min(c, pap);
    sum += min(b, rock);
    sum += min(a, sci);
    if (a >= sci) {
      extr = a - sci;
      a -= extr;
    }
    if (b >= rock) {
      extp = b - rock;
      b -= extp;
    }
    if (c >= pap) {
      exts = c - pap;
      c -= exts;
    }
    if (sum >= win) {
      for (long long i = 0; i < n; i++) {
        if (str[i] == 'P' && c > 0) {
          ans.push_back('S');
          c--;
          continue;
        } else if (str[i] == 'S' && a > 0) {
          ans.push_back('R');
          a--;
          continue;
        } else if (str[i] == 'R' && b > 0) {
          ans.push_back('P');
          b--;
          continue;
        } else {
          if (max(exts, max(extr, extp)) == extr) {
            ans.push_back('R');
            extr--;
          } else if (max(exts, max(extr, extp)) == extp) {
            ans.push_back('P');
            extp--;
          } else if (max(exts, max(extr, extp)) == exts) {
            ans.push_back('S');
            exts--;
          }
        }
      }
      cout << "YES" << endl;
      for (long long i = 0; i < ans.size(); i++) cout << ans[i];
      cout << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
