#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  long long n, a, b, c;
  string s;
  while (t--) {
    bool o[500] = {};
    cin >> n >> a >> b >> c >> s;
    long long cn = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == 'R' && b)
        s[i] = 'P', cn++, b--, o[i] = 1;
      else if (s[i] == 'P' && c)
        s[i] = 'S', cn++, c--, o[i] = 1;
      else if (s[i] == 'S' && a)
        s[i] = 'R', cn++, a--, o[i] = 1;
    }
    for (int i = 0; i < n; i++) {
      if (!o[i]) {
        if (a)
          s[i] = 'R', a--;
        else if (b)
          s[i] = 'P', b--;
        else
          s[i] = 'S', c--;
      }
    }
    if (2 * cn >= n)
      cout << "YES\n" << s << '\n';
    else
      cout << "NO\n";
  }
  return 0;
}
