#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a, b, c;
    int a1 = 0, b1 = 0, c1 = 0;
    int a2, b2, c2;
    string s;
    cin >> a >> b >> c;
    cin >> s;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == 'R') a1++;
      if (s[i] == 'P') b1++;
      if (s[i] == 'S') c1++;
    }
    a2 = min(a, c1);
    b2 = min(b, a1);
    c2 = min(c, b1);
    n = (n + 1) / 2;
    if (a2 + b2 + c2 < n) {
      printf("NO\n");
      continue;
    }
    char s1[102];
    for (int i = 0; i < 102; i++) {
      s1[i] = 'X';
    }
    a = a - a2;
    b = b - b2;
    c = c - c2;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == 'S' && a2) {
        a2--;
        s1[i] = 'R';
      }
      if (s[i] == 'R' && b2) {
        b2--;
        s1[i] = 'P';
      }
      if (s[i] == 'P' && c2) {
        c2--;
        s1[i] = 'S';
      }
    }
    for (int i = 0; i < s.size(); i++) {
      if (s1[i] == 'X') {
        if (a) {
          s1[i] = 'R';
          a--;
          continue;
        }
        if (b) {
          s1[i] = 'P';
          b--;
          continue;
        }
        if (c) {
          s1[i] = 'S';
          c--;
          continue;
        }
      }
    }
    printf("YES\n");
    for (int i = 0; i < s.size(); i++) {
      printf("%c", s1[i]);
    }
    cout << endl;
  }
  return 0;
}
