#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
void solve() {
  int n;
  cin >> n;
  int a, b, c;
  cin >> a >> b >> c;
  string s;
  cin >> s;
  int ap = 0, bp = 0, cp = 0;
  for (auto i : s) {
    if (i == 'R')
      ap++;
    else if (i == 'P')
      bp++;
    else
      cp++;
  }
  int wins = min(b, ap) + min(c, bp) + min(a, cp);
  if (wins >= ceil(((long double)1.0 * n / 2))) {
    cout << "YES\n";
    string ans(n, 'A');
    for (int i = 0; i < n; ++i) {
      if (s[i] == 'R') {
        if (b > 0) {
          ans[i] = 'P';
          b--;
        } else
          ans[i] = 'X';
      } else if (s[i] == 'P') {
        if (c > 0) {
          ans[i] = 'S';
          c--;
        } else
          ans[i] = 'X';
      } else {
        if (a > 0) {
          ans[i] = 'R';
          a--;
        } else
          ans[i] = 'X';
      }
    }
    for (int i = 0; i < n; ++i) {
      if (ans[i] == 'X') {
        if (a > 0) {
          ans[i] = 'R';
          a--;
        } else if (b > 0) {
          ans[i] = 'P';
          b--;
        } else {
          ans[i] = 'S';
        }
      }
    }
    cout << ans << '\n';
  } else
    cout << "NO\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  for (int i = 1; i <= t; ++i) {
    solve();
  }
}
