#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int tt;
  cin >> tt;
  while (tt--) {
    int n;
    cin >> n;
    int rr, pp, ss;
    cin >> rr >> pp >> ss;
    string s;
    cin >> s;
    string ans(n, 48);
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == 'S') {
        if (rr > 0) {
          rr--;
          ans[i] = 'R';
          cnt++;
        }
      }
      if (s[i] == 'R') {
        if (pp > 0) {
          pp--;
          ans[i] = 'P';
          cnt++;
        }
      }
      if (s[i] == 'P') {
        if (ss > 0) {
          ss--;
          ans[i] = 'S';
          cnt++;
        }
      }
    }
    int comp = (n / 2) + (n % 2 ? 1 : 0);
    if (cnt >= comp) {
      cout << "YES\n";
      for (int i = 0; i < n; i++) {
        if (ans[i] != '0')
          cout << ans[i];
        else {
          if (ss > 0) {
            cout << 'S';
            ss--;
          } else if (pp > 0) {
            cout << 'P';
            pp--;
          } else if (rr > 0) {
            cout << 'R';
            rr--;
          }
        }
      }
      cout << '\n';
    } else
      cout << "NO\n";
  }
}
