#include <bits/stdc++.h>
using namespace std;
long long inv_euclid(long long a, long long m = 998244353) {
  long long m0 = m;
  long long y = 0, x = 1;
  if (m == 1) return 0;
  while (a > 1) {
    long long q = a / m;
    long long t = m;
    m = a % m, a = t;
    t = y;
    y = x - q * y;
    x = t;
  }
  if (x < 0) x += m0;
  return x;
}
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long min(long long a, long long b) {
  if (a < b) return a;
  return b;
}
long long ssum(long long n) { return (n * (n + 1)) / 2; }
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a * b) / (gcd(a, b)); }
bool ok(long long x, long long y, long long n, long long m) {
  if (x < 0 || x > n - 1 || y < 0 || y > m - 1) return false;
  return true;
}
long long a[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long tttt;
  cin >> tttt;
  while (tttt--) {
    long long n, r, p, s, rr = 0, pp = 0, ss = 0;
    long long ans = 0;
    cin >> n >> r >> p >> s;
    string st;
    cin >> st;
    for (long long i = 0; i < n; i++) {
      if (st[i] == 'R')
        rr++;
      else if (st[i] == 'P')
        pp++;
      else
        ss++;
    }
    long long x, y, z, xx, yy, zz;
    x = min(r, ss);
    y = min(p, rr);
    z = min(s, pp);
    xx = r - x;
    yy = p - y;
    zz = s - z;
    if (x + y + z < ((n + 1) / 2)) {
      cout << "NO\n";
    } else {
      cout << "YES\n";
      for (long long i = 0; i < n; i++) {
        if (st[i] == 'R') {
          if (y) {
            cout << "P";
            y--;
          } else {
            if (xx) {
              cout << "R";
              xx--;
            } else if (yy) {
              cout << "P";
              yy--;
            } else if (zz) {
              cout << "S";
              zz--;
            }
          }
        } else if (st[i] == 'P') {
          if (z) {
            cout << "S";
            z--;
          } else {
            if (xx) {
              cout << "R";
              xx--;
            } else if (yy) {
              cout << "P";
              yy--;
            } else if (zz) {
              cout << "S";
              zz--;
            }
          }
        } else {
          if (x) {
            cout << "R";
            x--;
          } else {
            if (xx) {
              cout << "R";
              xx--;
            } else if (yy) {
              cout << "P";
              yy--;
            } else if (zz) {
              cout << "S";
              zz--;
            }
          }
        }
      }
      cout << "\n";
    }
  }
}
