#include <bits/stdc++.h>
using namespace std;
int wins(int x, int y) {
  if (x > y)
    return y;
  else
    return x;
}
int main() {
  int t, n, a, b, c;
  cin >> t;
  for (int i = 0; i < t; i++) {
    a = 0;
    b = 0;
    c = 0;
    n = 0;
    cin >> n >> a >> b >> c;
    char moves[n];
    int r = 0, p = 0, s = 0, star = 0, stap = 0, stas = 0;
    for (int j = 0; j < n; j++) {
      cin >> moves[j];
      switch (moves[j]) {
        case 'R':
          r++;
          break;
        case 'P':
          p++;
          break;
        case 'S':
          s++;
          break;
      }
    }
    if (a > s)
      stas = 1;
    else
      stas = 0;
    if (b > r)
      star = 1;
    else
      star = 0;
    if (c > p)
      stap = 1;
    else
      stap = 0;
    if (wins(a, s) + wins(b, r) + wins(c, p) < ceil(n / 2.))
      cout << "NO" << endl;
    else {
      cout << "YES" << endl;
      for (int k = 0; k < n; k++) {
        switch (moves[k]) {
          case 'S':
            if (a > 0) {
              a--;
              s--;
              if (a > s)
                stas = 1;
              else
                stas = 0;
              cout << "R";
            } else if (star == 1) {
              b--;
              s--;
              if (b > r)
                star = 1;
              else
                star = 0;
              cout << "P";
            } else if (stap == 1) {
              c--;
              s--;
              if (c > p)
                stap = 1;
              else
                stap = 0;
              cout << "S";
            }
            break;
          case 'P':
            if (c > 0) {
              c--;
              p--;
              if (c > p)
                stap = 1;
              else
                stap = 0;
              cout << "S";
            } else if (star == 1) {
              b--;
              p--;
              if (b > r)
                star = 1;
              else
                star = 0;
              cout << "P";
            } else if (stas == 1) {
              a--;
              p--;
              if (a > s)
                stas = 1;
              else
                stas = 0;
              cout << "R";
            }
            break;
          case 'R':
            if (b > 0) {
              b--;
              r--;
              if (b > r)
                star = 1;
              else
                star = 0;
              cout << "P";
            } else if (stas == 1) {
              a--;
              r--;
              if (a > s)
                stas = 1;
              else
                stas = 0;
              cout << "R";
            } else if (stap == 1) {
              c--;
              r--;
              if (c > p)
                stap = 1;
              else
                stap = 0;
              cout << "S";
            }
            break;
        }
      }
      cout << endl;
    }
  }
  return 0;
}
