#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, a, b, c;
    cin >> n >> a >> b >> c;
    string s, seq = "";
    cin >> s;
    seq = s;
    int prob = 0;
    bool check[n];
    for (int i = 0; i < n; ++i) check[i] = 0;
    for (int i = 0; i < n; ++i) {
      if (s[i] == 'R') {
        if (b > 0) {
          seq[i] = 'P';
          check[i] = 1;
          prob++;
          --b;
        }
      } else if (s[i] == 'P') {
        if (c > 0) {
          seq[i] = 'S';
          check[i] = 1;
          prob++;
          --c;
        }
      } else {
        if (a > 0) {
          seq[i] = 'R';
          check[i] = 1;
          prob++;
          --a;
        }
      }
    }
    int win = (n + (2 - 1)) / 2;
    if (prob >= win) {
      for (int i = 0; i < n; ++i) {
        if (check[i] == 0) {
          if (a > 0) {
            seq[i] = 'R';
            --a;
          } else if (b > 0) {
            seq[i] = 'P';
            --b;
          } else if (c > 0) {
            seq[i] = 'S';
            --c;
          }
        }
      }
      cout << "YES\n";
      cout << seq << "\n";
    } else
      cout << "NO\n";
  }
}
