#include <bits/stdc++.h>
using namespace std;
char ans[105];
char s[105];
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int n;
    int R, P, S;
    for (int i = 0; i <= 100; i++) ans[i] = 0;
    scanf("%d", &n);
    scanf("%d%d%d", &R, &P, &S);
    int ts = S, tr = R, tp = P;
    scanf("%s", s);
    int cnt = n;
    int cntr = 0, cntp = 0, cnts = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == 'R') {
        cntr++;
        if (P) {
          P--;
          ans[i] = 'P';
        }
      } else if (s[i] == 'P') {
        cntp++;
        if (S) {
          S--;
          ans[i] = 'S';
        }
      } else {
        cnts++;
        if (R) {
          R--;
          ans[i] = 'R';
        }
      }
    }
    if ((n + 1) / 2 > min(cnts, tr) + min(cntr, tp) + min(cntp, ts)) {
      puts("NO");
    } else {
      puts("YES");
      for (int i = 0; i < n; i++) {
        if (ans[i] != '\0')
          printf("%c", ans[i]);
        else {
          if (P) {
            P--;
            printf("P");
          } else if (R) {
            R--;
            printf("R");
          } else if (S) {
            S--;
            printf("S");
          }
        }
      }
      puts("");
    }
  }
  return 0;
}
