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