#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int T, n, a, b, c;
string s;
int shi, bu, jian;
int main() {
  cin >> T;
  while (T--) {
    shi = bu = jian = 0;
    cin >> n;
    cin >> a >> b >> c;
    cin >> s;
    for (int i = 0; i < s.length(); i++) {
      if (s[i] == 'R')
        shi++;
      else if (s[i] == 'P')
        bu++;
      else
        jian++;
    }
    if (min(a, jian) + min(b, shi) + min(c, bu) < (n + 1) / 2) {
      cout << "NO" << endl;
      continue;
    }
    cout << "YES" << endl;
    string t = "";
    for (int i = 0; i < s.length(); i++) {
      if (s[i] == 'R' && b) {
        t += 'P';
        b--;
      } else if (s[i] == 'P' && c) {
        t += 'S';
        c--;
      } else if (s[i] == 'S' && a) {
        a--;
        t += 'R';
      } else {
        t += '_';
      }
    }
    for (int i = 0; i != n; ++i) {
      if (t[i] != '_') continue;
      if (a) {
        t[i] = 'R';
        a--;
      } else if (b) {
        t[i] = 'P';
        b--;
      } else {
        t[i] = 'S';
        c--;
      }
    }
    cout << t << '\n';
  }
  return 0;
}
