#include <bits/stdc++.h>
using namespace std;
long long int ans[100001];
int main() {
  ios::sync_with_stdio(false);
  ;
  cin.tie(0);
  ;
  int i, j, n, t, x, y, a, b, c, p, r, s;
  string str;
  cin >> t;
  while (t--) {
    cin >> n;
    cin >> a >> b >> c;
    cin >> str;
    r = 0;
    p = 0;
    s = 0;
    for (i = 0; i < n; i++) {
      if (str[i] == 'R')
        r++;
      else if (str[i] == 'P')
        p++;
      else
        s++;
    }
    x = min(r, b) + min(p, c) + min(s, a);
    if (x < (n + 1) / 2) {
      cout << "NO"
           << "\n";
      continue;
    }
    cout << "YES"
         << "\n";
    for (i = 0; i < n; i++) ans[i] = -1;
    for (i = 0; i < n; i++) {
      if (str[i] == 'R' && b > 0) {
        ans[i] = 1;
        b--;
      } else if (str[i] == 'P' && c > 0) {
        ans[i] = 2;
        c--;
      } else if (str[i] == 'S' && a > 0) {
        ans[i] = 0;
        a--;
      }
    }
    for (i = 0; i < n; i++) {
      if (ans[i] != -1) continue;
      if (a > 0) {
        ans[i] = 0;
        a--;
      } else if (b > 0) {
        ans[i] = 1;
        b--;
      } else {
        ans[i] = 2;
        c--;
      }
    }
    for (i = 0; i < n; i++) {
      if (ans[i] == 0)
        cout << "R";
      else if (ans[i] == 1)
        cout << "P";
      else
        cout << "S";
    }
    cout << "\n";
  }
  return 0;
}
