#include <bits/stdc++.h>
using namespace std;
int a[5], cnt[5], rest[5];
char c[] = {'0', 'R', 'P', 'S'};
void Print() {
  for (int j = 1; j <= 3; j++)
    while (rest[j] > 0) {
      cout << c[j];
      rest[j]--;
      return;
    }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    cin >> a[1] >> a[2] >> a[3];
    string s;
    cin >> s;
    cnt[1] = cnt[2] = cnt[3] = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == 'R') cnt[2]++;
      if (s[i] == 'P') cnt[3]++;
      if (s[i] == 'S') cnt[1]++;
    }
    int sum = 0;
    for (int i = 1; i <= 3; i++) {
      cnt[i] = min(cnt[i], a[i]);
      rest[i] = max(0, a[i] - cnt[i]);
      sum += cnt[i];
    }
    if (sum >= (n + 1) / 2) {
      cout << "YES" << '\n';
      for (int i = 0; i < s.size(); i++) {
        if (s[i] == 'R') {
          if (cnt[2] > 0) {
            cout << 'P';
            cnt[2]--;
          } else
            Print();
        }
        if (s[i] == 'P') {
          if (cnt[3] > 0) {
            cout << 'S';
            cnt[3]--;
          } else
            Print();
        }
        if (s[i] == 'S') {
          if (cnt[1] > 0) {
            cout << 'R';
            cnt[1]--;
          } else
            Print();
        }
      }
      cout << '\n';
    } else
      cout << "NO" << '\n';
  }
}
