#include <bits/stdc++.h>
using namespace std;
long long int pow1(long long int a, long long int b) {
  long long int ans = 1;
  while (b) {
    if (b & 1) {
      ans = ans * a;
    }
    a = a * a;
    b = b >> 1;
  }
  return ans;
}
int main() {
  int n, a, b, c, t, i, j;
  cin >> t;
  while (t--) {
    string second;
    cin >> n;
    cin >> a >> b >> c;
    cin >> second;
    string ans = second;
    int cntr = 0, cnts = 0, cntp = 0;
    for (i = 0; i < n; i++)
      if (second[i] == 'S')
        cntr++;
      else if (second[i] == 'R')
        cntp++;
      else if (second[i] == 'P')
        cnts++;
    int tot = 0;
    for (i = 0; i < n && a; i++)
      if (second[i] == 'S') {
        ans[i] = 'R';
        a--;
        tot++;
      }
    if (tot >= ceil(double(n) / 2.0)) {
      for (i = 0; i < n; i++)
        if (second[i] == ans[i]) {
          if (a > 0) {
            ans[i] = 'R';
            a--;
          } else if (b > 0) {
            ans[i] = 'P';
            b--;
          } else if (c > 0) {
            ans[i] = 'S';
            c--;
          }
        }
      cout << "YES" << endl;
      cout << ans << endl;
      continue;
    }
    for (i = 0; i < n && b; i++)
      if (second[i] == 'R') {
        ans[i] = 'P';
        b--;
        tot++;
      }
    if (tot >= ceil(double(n) / 2.0)) {
      for (i = 0; i < n; i++)
        if (second[i] == ans[i]) {
          if (a > 0) {
            ans[i] = 'R';
            a--;
          } else if (b > 0) {
            ans[i] = 'P';
            b--;
          } else if (c > 0) {
            ans[i] = 'S';
            c--;
          }
        }
      cout << "YES" << endl;
      cout << ans << endl;
      continue;
    }
    for (i = 0; i < n && c; i++)
      if (second[i] == 'P') {
        ans[i] = 'S';
        c--;
        tot++;
      }
    if (tot >= ceil(double(n) / 2.0)) {
      for (i = 0; i < n; i++)
        if (second[i] == ans[i]) {
          if (a > 0) {
            ans[i] = 'R';
            a--;
          } else if (b > 0) {
            ans[i] = 'P';
            b--;
          } else if (c > 0) {
            ans[i] = 'S';
            c--;
          }
        }
      cout << "YES" << endl;
      cout << ans << endl;
      continue;
    }
    cout << "NO" << endl;
  }
  return 0;
}
