#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, a, b, c, aa = 0, bb = 0, cc = 0, w;
    cin >> n >> a >> b >> c;
    w = n / 2 + n % 2;
    string x;
    cin >> x;
    char ans[105];
    for (int i = 0; i < x.size(); ++i) {
      ans[i] = '0';
      if (x[i] == 'R') {
        ++aa;
      } else if (x[i] == 'P') {
        ++bb;
      } else {
        ++cc;
      }
    }
    int sum = min(a, cc) + min(b, aa) + min(c, bb);
    if (sum >= w) {
      cout << "YES\n";
      for (int j = 0; j < x.size() && min(a, cc); ++j) {
        if (x[j] == 'S') {
          ans[j] = 'R';
          --a;
          --cc;
        }
      }
      for (int j = 0; j < x.size() && min(b, aa); ++j) {
        if (x[j] == 'R') {
          ans[j] = 'P';
          --b;
          --aa;
        }
      }
      for (int j = 0; j < x.size() && min(c, bb); ++j) {
        if (x[j] == 'P') {
          ans[j] = 'S';
          --c;
          --bb;
        }
      }
      for (int j = 0; j < x.size(); ++j) {
        if (ans[j] == '0') {
          if (a) {
            --a;
            ans[j] = 'R';
          } else if (b) {
            --b;
            ans[j] = 'P';
          } else if (c) {
            --c;
            ans[j] = 'S';
          }
        }
        cout << ans[j];
      }
      cout << "\n";
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}
