#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    string s;
    int j, n, x, a, b, c;
    cin >> n;
    cin >> a >> b >> c;
    cin >> s;
    int p[n];
    x = 0;
    for (int i = 0; i < n; i++) {
      p[i] = 0;
      if (s[i] == 'R' && b > 0) {
        b--;
        x++;
        p[i] = 2;
      }
      if (s[i] == 'P' && c > 0) {
        c--;
        x++;
        p[i] = 3;
      }
      if (s[i] == 'S' && a > 0) {
        a--;
        x++;
        p[i] = 1;
      }
    }
    j = (n + 1) / 2;
    if (x >= j) {
      cout << "Yes"
           << "\n";
      for (int i = 0; i < n; i++) {
        if (p[i] == 1) cout << "R";
        if (p[i] == 2) cout << "P";
        if (p[i] == 3) cout << "S";
        if (p[i] == 0) {
          if (a > 0) {
            a--;
            cout << "R";
          } else {
            if (b > 0) {
              b--;
              cout << "P";
            } else {
              c--;
              cout << "S";
            }
          }
        }
      }
      cout << "\n";
    } else {
      cout << "No"
           << "\n";
    }
  }
  return 0;
}
