#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, a, b, c;
  cin >> n;
  string S;
  cin >> a >> b >> c >> S;
  int res = 0;
  for (int i = 0; i < n; i++) {
    if (S[i] == 'S') {
      if (a > 0) {
        S[i] = 'R';
        a--;
        res++;
      } else
        S[i] = 'X';
    } else if (S[i] == 'R') {
      if (b > 0) {
        S[i] = 'P';
        b--;
        res++;
      } else
        S[i] = 'X';
    } else if (S[i] == 'P') {
      if (c > 0) {
        S[i] = 'S';
        c--;
        res++;
      } else
        S[i] = 'X';
    }
  }
  if (res < ceil(n / 2.0))
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (int i = 0; i < n; i++) {
      if (S[i] == 'X') {
        if (a > 0) {
          S[i] = 'R';
          a--;
        } else if (b > 0) {
          S[i] = 'P';
          b--;
        } else if (c > 0) {
          S[i] = 'S';
          c--;
        }
      }
    }
    cout << S << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int q = 1;
  cin >> q;
  for (int kase = 1; kase <= q; kase++) {
    solve();
  }
  return 0;
}
