#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, BUA, BAO, KEO;
    cin >> n >> BUA >> BAO >> KEO;
    string s;
    cin >> s;
    int bua = 0, bao = 0, keo = 0;
    for (int i = 0; i < s.length(); i++) {
      if (s[i] == 'R')
        bua++;
      else if (s[i] == 'P')
        bao++;
      else
        keo++;
    }
    int x = min(BAO, bua);
    int y = min(KEO, bao);
    int z = min(BUA, keo);
    BAO -= x;
    KEO -= y;
    BUA -= z;
    int Win = x + y + z;
    if (Win >= (n + 1) / 2) {
      cout << "YES\n";
      vector<bool> Mark(int(s.length()), 1);
      for (int i = 0; i < s.length(); i++) {
        if (s[i] == 'R' && x > 0) {
          s[i] = 'P';
          x--;
          Mark[i] = 0;
        } else if (s[i] == 'P' && y > 0) {
          s[i] = 'S';
          y--;
          Mark[i] = 0;
        } else if (s[i] == 'S' && z > 0) {
          s[i] = 'R';
          z--;
          Mark[i] = 0;
        }
      }
      for (int i = 0; i < s.length(); i++) {
        if (Mark[i] == 1) {
          if (BAO > 0) {
            s[i] = 'P';
            BAO--;
          } else if (BUA > 0) {
            s[i] = 'R';
            BUA--;
          } else if (KEO > 0) {
            s[i] = 'S';
            KEO--;
          }
        }
      }
      cout << s << "\n";
    } else
      cout << "NO\n";
  }
}
