#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int q;
  cin >> q;
  while (q--) {
    int n, a, b, c;
    cin >> n >> a >> b >> c;
    string ss;
    cin >> ss;
    int r, p, s;
    r = p = s = 0;
    for (char m : ss) {
      if (m == 'R')
        r++;
      else if (m == 'P')
        p++;
      else
        s++;
    }
    if (min(a, s) + min(b, r) + min(c, p) < (n + 1) / 2)
      cout << "NO\n";
    else {
      string res(n, 'Q');
      cout << "YES\n";
      for (int i = 0; i < n; i++) {
        if (ss[i] == 'R' && b > 0) {
          res[i] = 'P';
          b--;
        } else if (ss[i] == 'P' && c > 0) {
          res[i] = 'S';
          c--;
        } else if (ss[i] == 'S' && a > 0) {
          res[i] = 'R';
          a--;
        }
      }
      for (int i = 0; i < n; i++) {
        if (res[i] == 'Q') {
          if (a-- > 0)
            res[i] = 'R';
          else if (b-- > 0)
            res[i] = 'P';
          else if (c-- > 0)
            res[i] = 'S';
        }
      }
      cout << res << endl;
    }
  }
  return 0;
}
