#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, rb, pb, sb, ra, pa, sa, win;
  bool vu[101];
  string s;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> n >> ra >> pa >> sa;
    cin >> s;
    string ans;
    for (int j = 0; j < n; j++) {
      ans.push_back('a');
      vu[j] = false;
    }
    rb = pb = sb = win = 0;
    for (int j = 0; j < n; j++) {
      switch (s[j]) {
        case 'R': {
          if (pa > 0) {
            win++;
            pa--;
            vu[j] = true;
            ans[j] = 'P';
          }
          break;
        }
        case 'P': {
          if (sa > 0) {
            win++;
            sa--;
            vu[j] = true;
            ans[j] = 'S';
          }
          break;
        }
        case 'S': {
          if (ra > 0) {
            win++;
            ra--;
            vu[j] = true;
            ans[j] = 'R';
          }
          break;
        }
      }
    }
    if (win >= (n + 1) / 2)
      cout << "YES" << endl;
    else {
      cout << "NO" << endl;
      continue;
    }
    for (int j = 0; j < n; j++) {
      if (!vu[j]) {
        if (sa > 0) {
          ans[j] = 'S';
          sa--;
        } else if (ra > 0) {
          ans[j] = 'R';
          ra--;
        } else if (pa > 0) {
          ans[j] = 'P';
          pa--;
        } else
          cout << "oups";
      }
    }
    cout << ans << endl;
  }
  return 0;
}
