#include <bits/stdc++.h>
using namespace std;
int T, n, arr[4], win;
char str[102], ans[102];
int main() {
  scanf("%d", &T);
  while (T--) {
    win = 0;
    scanf("%d %d %d %d %s", &n, &arr[0], &arr[1], &arr[2], str);
    for (int i = 0; i < n; i++) {
      if (str[i] == 'R') {
        if (arr[1] > 0) {
          ans[i] = 'P';
          arr[1]--;
          win++;
        } else {
          ans[i] = '*';
        }
      }
      if (str[i] == 'P') {
        if (arr[2] > 0) {
          ans[i] = 'S';
          arr[2]--;
          win++;
        } else {
          ans[i] = '*';
        }
      }
      if (str[i] == 'S') {
        if (arr[0] > 0) {
          ans[i] = 'R';
          arr[0]--;
          win++;
        } else {
          ans[i] = '*';
        }
      }
    }
    queue<char> q;
    while (arr[0]--) {
      q.push('R');
    }
    while (arr[1]--) {
      q.push('P');
    }
    while (arr[2]--) {
      q.push('S');
    }
    if (win * 2 < n) {
      printf("NO\n");
    } else {
      printf("YES\n");
      for (int i = 0; i < n; i++) {
        if (ans[i] == '*') {
          printf("%c", (char)q.front());
          q.pop();
        } else {
          printf("%c", (char)ans[i]);
        }
      }
      printf("\n");
    }
  }
  return 0;
}
