#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
int rock, paper, sci, n, rl, pl, sl;
int updiv(int a, int b) {
  int tmp = a / b;
  return tmp * b < a ? tmp + 1 : tmp;
}
char counter(char x) {
  if (x == 'R')
    return 'P';
  else if (x == 'P')
    return 'S';
  else
    return 'R';
}
char residue(int rl, int pl, int sl) {
  if (rock - rl > 0) {
    rl--, rock--;
    return 'R';
  } else if (paper - pl > 0) {
    pl--, paper--;
    return 'P';
  } else if (sci - sl > 0) {
    sl--, sci--;
    return 'S';
  }
}
int main() {
  int nQ;
  scanf("%d", &nQ);
  while (nQ--) {
    scanf("%d", &n);
    scanf("%d%d%d", &rock, &paper, &sci);
    int br = 0, bp = 0, bs = 0;
    string s;
    cin >> s;
    for (int i = 0; i < n; i++) {
      if (s[i] == 'R')
        br++;
      else if (s[i] == 'P')
        bp++;
      else
        bs++;
    }
    int win = 0;
    win = min(br, paper) + min(bs, rock) + min(bp, sci);
    rl = min(bs, rock), pl = min(br, paper), sl = min(bp, sci);
    if (win >= updiv(n, 2)) {
      printf("YES\n");
      for (int i = 0; i < n; i++) {
        if (s[i] == 'R') {
          if (pl > 0) {
            printf("%c", counter(s[i]));
            pl--;
            paper--;
          } else {
            printf("%c", residue(rl, pl, sl));
          }
        } else if (s[i] == 'P') {
          if (sl > 0) {
            printf("%c", counter(s[i]));
            sl--;
            sci--;
          } else {
            printf("%c", residue(rl, pl, sl));
          }
        } else {
          if (rl > 0) {
            printf("%c", counter(s[i]));
            rl--;
            rock--;
          } else {
            printf("%c", residue(rl, pl, sl));
          }
        }
      }
      printf("\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
