#include <bits/stdc++.h>
using namespace std;
int main() {
  cout << setprecision(16);
  int n, a, b, c, t;
  string m;
  cin >> t;
  while (t-- > 0) {
    cin >> n >> a >> b >> c;
    cin >> m;
    int r = 0, p = 0, s = 0;
    for (auto c : m) {
      if (c == 'R') {
        r++;
      } else if (c == 'P') {
        p++;
      } else {
        s++;
      }
    }
    char arr[n];
    for (auto i = 0; i != n; i++) {
      arr[i] = ' ';
    }
    int score = min(b, r) + min(c, p) + min(a, s);
    if (score >= (n + 1) / 2) {
      cout << "YES\n";
      for (int i = 0; i < n; i++) {
        if (m[i] == 'R' && b > 0) {
          b--;
          arr[i] = 'P';
        }
        if (m[i] == 'P' && c > 0) {
          c--;
          arr[i] = 'S';
        }
        if (m[i] == 'S' && a > 0) {
          a--;
          arr[i] = 'R';
        }
      }
      for (auto i = 0; i != n; i++) {
        if (arr[i] == ' ') {
          if (a > 0) {
            a--;
            arr[i] = 'R';
          } else if (b > 0) {
            b--;
            arr[i] = 'P';
          } else if (c > 0) {
            c--;
            arr[i] = 'S';
          }
        }
      }
      for (auto i = 0; i != n; i++) {
        cout << arr[i];
      }
      cout << '\n';
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}
