#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    int n, m;
    cin >> n;
    int a, b, c;
    cin >> a >> b >> c;
    string s;
    cin >> s;
    string ans = "";
    int win = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == 'R') {
        if (b > 0) {
          b--;
          ans += 'P';
          win++;
        } else
          ans += '0';
      } else if (s[i] == 'P') {
        if (c > 0) {
          c--;
          ans += 'S';
          win++;
        } else
          ans += '0';
      } else if (s[i] == 'S') {
        if (a > 0) {
          a--;
          ans += 'R';
          win++;
        } else
          ans += '0';
      }
    }
    int x = ceil(double(n) / 2.0);
    if (win >= x) {
      cout << "YES" << endl;
      for (int i = 0; i < n; i++) {
        if (ans[i] == '0') {
          if (a > 0) {
            a--;
            cout << 'R';
          } else if (b > 0) {
            b--;
            cout << 'P';
          } else if (c > 0) {
            c--;
            cout << 'S';
          }
        } else
          cout << ans[i];
      }
      cout << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
