#include <bits/stdc++.h>
using namespace std;
int r1, p1, s1, r2, p2, s2;
char s[120];
int ret[120];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    scanf("%d", &n);
    memset(ret, 0, sizeof(ret));
    scanf("%d%d%d", &r1, &p1, &s1);
    scanf("%s", s);
    r2 = 0;
    p2 = 0;
    s2 = 0;
    for (int a = 0; a < n; a++) {
      if (s[a] == 'R') r2++;
      if (s[a] == 'P') p2++;
      if (s[a] == 'S') s2++;
    }
    int cnt = (n + 1) / 2;
    int ans = min(r1, s2) + min(p1, r2) + min(s1, p2);
    if (ans < cnt) {
      printf("NO\n");
      continue;
    }
    printf("YES\n");
    for (int a = 0; a < n; a++) {
      if (s[a] == 'R' && p1 > 0) {
        ret[a] = 2;
        p1--;
      }
      if (s[a] == 'P' && s1 > 0) {
        ret[a] = 3;
        s1--;
      }
      if (s[a] == 'S' && r1 > 0) {
        ret[a] = 1;
        r1--;
      }
    }
    for (int a = 0; a < n; a++) {
      if (ret[a] == 0) {
        if (r1 > 0) {
          ret[a] = 1;
          r1--;
          continue;
        }
        if (p1 > 0) {
          ret[a] = 2;
          p1--;
          continue;
        }
        if (s1 > 0) {
          ret[a] = 3;
          s1--;
          continue;
        }
      }
    }
    for (int a = 0; a < n; a++) {
      if (ret[a] == 1) printf("R");
      if (ret[a] == 2) printf("P");
      if (ret[a] == 3) printf("S");
      if (ret[a] == 0) printf("0");
    }
    printf("\n");
  }
  return 0;
}
