#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a, b, c;
    cin >> a >> b >> c;
    string s;
    cin >> s;
    long long r = count(s.begin(), s.end(), 'R');
    long long p = count(s.begin(), s.end(), 'P');
    long long second = count(s.begin(), s.end(), 'S');
    long long m = min(a, second) + min(b, r) + min(c, p);
    if (2 * m < n) {
      cout << "NO\n";
    } else {
      cout << "YES\n";
      string ans = "";
      for (long long i = 0; i < n; i++) {
        if (s[i] == 'R' && b)
          ans += 'P', b--;
        else if (s[i] == 'P' && c)
          ans += 'S', c--;
        else if (s[i] == 'S' && a)
          ans += 'R', a--;
        else
          ans += '*';
      }
      for (long long i = 0; i < n; i++) {
        if (ans[i] != '*') continue;
        if (a) {
          ans[i] = 'R';
          a--;
        } else if (c) {
          ans[i] = 'S';
          c--;
        } else if (b) {
          ans[i] = 'P';
          b--;
        }
      }
      cout << ans << "\n";
    }
  }
  return 0;
}
