#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  if (y > x) std::swap(y, x);
  if (y == 0) return x;
  return gcd(y, x % y);
}
char q1[200];
char q2[200];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a1[3];
    int n;
    memset(q2, 0, sizeof(q2));
    cin >> n;
    for (int i = 0; i < 3; i++) cin >> a1[i];
    cin >> q1;
    int an = 0;
    for (int i = 0; i < strlen(q1); i++)
      if (q1[i] == 'R' && a1[1] > 0)
        q2[i] = 'P', an++, a1[1]--;
      else if (q1[i] == 'P' && a1[2] > 0)
        q2[i] = 'S', an++, a1[2]--;
      else if (q1[i] == 'S' && a1[0] > 0)
        q2[i] = 'R', an++, a1[0]--;
    for (int i = 0; i < strlen(q1); i++)
      if (q2[i] != 'R' && q2[i] != 'P' && q2[i] != 'S') {
        if (a1[1] > 0)
          q2[i] = 'P', a1[1]--;
        else if (a1[2] > 0)
          q2[i] = 'S', a1[2]--;
        else if (a1[0] > 0)
          q2[i] = 'R', a1[0]--;
      }
    if (an * 2 >= n) {
      puts("YES");
      printf("%s\n", q2);
    } else
      puts("NO");
  }
}
