#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
bool comp(int a, int b) { return (a > b); }
long long binaryexp(long long a, long long b) {
  long long ans = 1;
  while (b > 0) {
    if (b & 1) {
      ans = (ans * a) % MOD;
    }
    a = (a * a) % MOD;
    b = b >> 1;
  }
  return ans;
}
vector<int> b(1000001, 0);
int gcd(int a, int b) {
  if (b == 0) {
    return a;
  }
  if (b > a) {
    return gcd(b, a);
  } else {
    return gcd(b, a % b);
  }
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    int a, b, c;
    cin >> a >> b >> c;
    int wins = 0;
    string s;
    cin >> s;
    vector<char> v(n, 'k');
    for (int i = 0; i < n; i++) {
      if (s[i] == 'R' && b > 0) {
        wins++;
        b--;
        v[i] = 'P';
      } else if (s[i] == 'P' && c != 0) {
        wins++;
        c--;
        v[i] = 'S';
      } else if (s[i] == 'S' && a != 0) {
        wins++;
        a--;
        v[i] = 'R';
      }
    }
    if (wins < (n + 1) / 2) {
      cout << "NO"
           << "\n";
    } else {
      cout << "YES"
           << "\n";
      for (int i = 0; i < n; i++) {
        if (v[i] == 'k') {
          if (a > 0) {
            v[i] = 'R';
            a--;
          } else if (b > 0) {
            v[i] = 'P';
            b--;
          } else if (c > 0) {
            v[i] = 'S';
            c--;
          }
        }
        cout << v[i];
      }
      cout << "\n";
    }
  }
}
