#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, r, p, ss, win = 0;
  cin >> n;
  cin >> r >> p >> ss;
  string s, ans;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'R' && p) {
      p--;
      ans += 'P';
      win++;
    } else if (s[i] == 'P' && ss) {
      ss--;
      ans += 'S';
      win++;
    } else if (s[i] == 'S' && r) {
      r--;
      ans += 'R';
      win++;
    } else
      ans += '_';
  }
  for (int i = 0; i < n; i++) {
    if (ans[i] != '_') continue;
    if (r) {
      ans[i] = 'R';
      r--;
    } else if (p) {
      ans[i] = 'P';
      p--;
    } else {
      ans[i] = 'S';
      ss--;
    }
  }
  if (win < (n + 1) / 2) {
    cout << "NO";
  } else {
    cout << "YES"
         << "\n";
    cout << ans;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long T;
  cin >> T;
  while (T--) {
    solve();
    cout << "\n";
  }
  return 0;
}
