#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
int run_test() {
  int n;
  cin >> n;
  int a, b, c;
  cin >> a >> b >> c;
  string st;
  cin >> st;
  int r = 0, p = 0, s = 0;
  for (int i = 0; i < n; i++) {
    if (st[i] == 'R')
      r++;
    else if (st[i] == 'P')
      p++;
    else {
      s++;
    }
  }
  int ans = 0;
  ans += min(s, a) + min(r, b) + min(p, c);
  if (ans >= (n + 1) / 2) {
    cout << "yes\n";
    vector<char> final(n, '.');
    for (int i = 0; i < n; i++) {
      if (st[i] == 'R') {
        if (b > 0) {
          final[i] = 'P';
          b--;
        }
      }
      if (st[i] == 'P') {
        if (c > 0) {
          final[i] = 'S';
          c--;
        }
      }
      if (st[i] == 'S') {
        if (a > 0) {
          final[i] = 'R';
          a--;
        }
      }
    }
    for (int i = 0; i < n; i++) {
      if (final[i] == '.') {
        if (a > 0) {
          final[i] = 'R';
          a--;
        } else if (b > 0) {
          final[i] = 'P';
          b--;
        } else if (c > 0) {
          final[i] = 'S';
          c--;
        }
      }
    }
    for (auto x : final) {
      cout << x;
    }
    cout << "\n";
  } else {
    cout << "No\n";
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int tt;
  tt = 1;
  cin >> tt;
  while (tt--) {
    run_test();
  }
}
