#include <bits/stdc++.h>
using namespace std;
char ans[1000010];
int main() {
  int t;
  cin >> t;
  while (t--) {
    memset(ans, 0, sizeof ans);
    double n;
    int point = 0;
    cin >> n;
    int r, p, s;
    cin >> r >> p >> s;
    string a;
    cin >> a;
    int x;
    for (x = 0; x < a.size(); x++) {
      if (a[x] == 'R' && p > 0) {
        point += 1;
        ans[x] = 'P';
        p -= 1;
      } else if (a[x] == 'P' && s > 0) {
        point += 1;
        ans[x] = 'S';
        s -= 1;
      } else if (a[x] == 'S' && r > 0) {
        point += 1;
        ans[x] = 'R';
        r -= 1;
      } else {
        ans[x] = ' ';
      }
    }
    if (point >= ceil(n / 2)) {
      cout << "YES" << endl;
      for (x = 0; x < a.size(); x++) {
        if (ans[x] != ' ') {
          cout << ans[x];
        } else {
          if (r > 0) {
            r -= 1;
            cout << "R";
          } else if (s > 0) {
            s -= 1;
            cout << "S";
          } else if (p > 0) {
            p -= 1;
            cout << "P";
          }
        }
      }
      cout << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
