#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 5;
const double eps = 1e-9;
const long long INF = 1e18;
char str[1005];
char ans[1005];
signed main() {
  long long T;
  cin >> T;
  while (T--) {
    long long n;
    cin >> n;
    long long a1, b1, c1;
    cin >> a1 >> b1 >> c1;
    scanf("%s", str + 1);
    long long beat = 0;
    memset(ans, 0, sizeof(ans));
    for (long long i = 1; i <= n; i++) {
      if (str[i] == 'R' && b1) b1--, beat++, ans[i] = 'P';
      if (str[i] == 'P' && c1) c1--, beat++, ans[i] = 'S';
      if (str[i] == 'S' && a1) a1--, beat++, ans[i] = 'R';
    }
    bool flag = 0;
    if (n % 2 == 1 && beat <= n / 2) {
      puts("NO");
      flag = 1;
    } else if (n % 2 == 0 && beat < n / 2) {
      puts("NO");
      flag = 1;
    }
    for (long long i = 1; i <= n; i++) {
      if (!ans[i]) {
        if (a1)
          a1--, ans[i] = 'R';
        else if (b1)
          b1--, ans[i] = 'P';
        else if (c1)
          c1--, ans[i] = 'S';
      }
    }
    if (flag) continue;
    puts("YES");
    for (long long i = 1; i <= n; i++) putchar(ans[i]);
    putchar('\n');
  }
  return 0;
}
