#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, r, p, s, wins = 0;
    string st, res;
    cin >> n >> r >> p >> s >> st;
    for (int i = 0; i < n; i++) {
      if (st[i] == 'R') {
        if (p > 0) {
          wins++;
          p--;
          res.push_back('P');
        } else
          res.push_back('X');
      } else if (st[i] == 'P') {
        if (s > 0) {
          wins++;
          s--;
          res.push_back('S');
        } else
          res.push_back('X');
      } else {
        if (r > 0) {
          wins++;
          r--;
          res.push_back('R');
        } else
          res.push_back('X');
      }
    }
    if (wins >= (n + 1) / 2) {
      for (int i = 0; i < n; i++) {
        if (res[i] == 'X') {
          if (r > 0) {
            res[i] = 'R';
            r--;
          } else if (p > 0) {
            res[i] = 'P';
            p--;
          } else {
            res[i] = 'S';
            s--;
          }
        }
      }
      cout << "YES" << '\n' << res << '\n';
    } else {
      cout << "NO" << '\n';
    }
  }
}
