#include <bits/stdc++.h>
using namespace std;
char s[100 + 5];
char ans[100 + 5];
int main() {
  int n;
  scanf("%d", &n);
  while (n--) {
    int m;
    int a, b, c;
    int win_t = 0;
    scanf("%d", &m);
    scanf("%d%d%d", &a, &b, &c);
    scanf("%s", s);
    for (int i = 0; i < m; i++) ans[i] = '0';
    for (int i = 0; i < m; i++) {
      if (s[i] == 'R' && b > 0) {
        win_t++;
        b--;
        ans[i] = 'P';
      } else if (s[i] == 'P' && c > 0) {
        win_t++;
        c--;
        ans[i] = 'S';
      } else if (s[i] == 'S' && a > 0) {
        win_t++;
        a--;
        ans[i] = 'R';
      }
    }
    for (int i = 0; i < m; i++) {
      if (ans[i] == '0') {
        if (a > 0) {
          a--;
          ans[i] = 'R';
        } else if (b > 0) {
          b--;
          ans[i] = 'P';
        } else {
          c--;
          ans[i] = 'S';
        }
      }
    }
    ans[m] = '\0';
    if (win_t >= ceil(m / 2.0)) {
      printf("YES\n");
      printf("%s\n", ans);
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
