#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[3], b[] = {0, 0, 0};
    cin >> a[0] >> a[1] >> a[2];
    string s;
    cin >> s;
    for (int i = 0; i < n; i++) {
      if (s[i] == 'R') b[1]++;
      if (s[i] == 'P') b[2]++;
      if (s[i] == 'S') b[0]++;
    }
    int cnt = 0;
    for (int i = 0; i < 3; i++) {
      cnt += min(a[i], b[i]);
    }
    if (cnt < (n + 1) / 2) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
      char ans[111];
      memset(ans, 0, sizeof ans);
      for (int i = 0; i < n; i++) {
        int t = -1;
        if (s[i] == 'R' && a[1] > 0) {
          t = 1;
          a[1]--;
        }
        if (s[i] == 'P' && a[2] > 0) {
          t = 2;
          a[2]--;
        }
        if (s[i] == 'S' && a[0] > 0) {
          t = 0;
          a[0]--;
        }
        string ch = "RPS";
        ans[i] = ch[t];
      }
      for (int i = 0; i < n; i++) {
        if (ans[i] != 0) continue;
        int t = -1;
        if (a[1] > 0) {
          t = 1;
        } else if (a[2] > 0) {
          t = 2;
        } else if (a[0] > 0) {
          t = 0;
        }
        string ch = "RPS";
        ans[i] = ch[t];
        a[t]--;
      }
      printf("%s\n", ans);
    }
  }
}
