#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) { return (a > b) ? a : b; }
long long min(long long a, long long b) { return (a < b) ? a : b; }
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n, cnt = 0;
    cin >> n;
    long long a, b, c, flag = 0, scr = 0, paper = 0, rock = 0;
    cin >> a >> b >> c;
    string s, d = "";
    char s1[n];
    cin >> s;
    for (long long i = 0; i < n; i++) s1[i] = '0';
    for (long long i = 0; i < n; i++) {
      if (s[i] == 'S' && a > 0) {
        s1[i] = 'R';
        a--;
        cnt++;
      } else if (s[i] == 'R' && b > 0) {
        s1[i] = 'P';
        b--;
        cnt++;
      } else if (s[i] == 'P' && c > 0) {
        s1[i] = 'S';
        c--;
        cnt++;
      }
    }
    if (cnt < ceil((float)n / 2))
      cout << "NO"
           << "\n";
    else {
      cout << "YES"
           << "\n";
      long long i = 0;
      while (a > 0) {
        if (s1[i] == '0') {
          s1[i] = 'R';
          a--;
        }
        i++;
      }
      i = 0;
      while (b > 0) {
        if (s1[i] == '0') {
          s1[i] = 'P';
          b--;
        }
        i++;
      }
      i = 0;
      while (c > 0) {
        if (s1[i] == '0') {
          s1[i] = 'S';
          c--;
        }
        i++;
      }
      for (long long i = 0; i < n; i++) cout << s1[i];
      cout << "\n";
    }
  }
  return 0;
}
