#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int a, b, c;
  cin >> a >> b >> c;
  string q;
  cin >> q;
  string ans = "";
  for (int i = 0; i < q.length(); ++i) {
    if (q[i] == 'R') {
      if (b > 0) {
        b--;
        ans += 'P';
      } else
        ans += '_';
    } else if (q[i] == 'P') {
      if (c > 0) {
        c--;
        ans += 'S';
      } else
        ans += '_';
    } else {
      if (a > 0) {
        --a;
        ans += 'R';
      } else
        ans += '_';
    }
  }
  int win = n;
  for (int i = 0; i < n; ++i) {
    if (ans[i] == '_') {
      if (a > 0)
        ans[i] = 'R', --a;
      else if (b > 0)
        ans[i] = 'P', --b;
      else
        ans[i] = 'S', --c;
      --win;
    }
  }
  int x = round(float(n) / 2);
  if (win >= x) {
    cout << "YES\n";
    cout << ans << "\n";
  } else
    cout << "NO\n";
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
