#include <bits/stdc++.h>
using namespace std;
int alice[3], bob[3], resup[3];
int cnt, n;
string str;
vector<char> v;
void re() {
  if (resup[0] > 0) {
    v.push_back('R');
    resup[0]--;
  } else if (resup[1] > 0) {
    v.push_back('P');
    resup[1]--;
  } else {
    v.push_back('S');
    resup[2]--;
  }
}
void f() {
  for (int i = 0; i < str.length(); i++) {
    if (str[i] == 'R') {
      if (alice[1] <= 0)
        re();
      else {
        v.push_back('P');
        alice[1]--;
        cnt++;
      }
    } else if (str[i] == 'P') {
      if (alice[2] <= 0)
        re();
      else {
        v.push_back('S');
        alice[2]--;
        cnt++;
      }
    } else {
      if (alice[0] <= 0)
        re();
      else {
        v.push_back('R');
        alice[0]--;
        cnt++;
      }
    }
  }
}
int main(void) {
  int tc;
  scanf("%d", &tc);
  while (tc--) {
    v.clear();
    cnt = 0;
    bob[0] = bob[1] = bob[2] = 0;
    scanf("%d", &n);
    scanf("%d %d %d", &alice[0], &alice[1], &alice[2]);
    cin.ignore();
    cin >> str;
    for (int i = 0; i < str.length(); i++) {
      if (str[i] == 'R')
        bob[0]++;
      else if (str[i] == 'P')
        bob[1]++;
      else
        bob[2]++;
    }
    resup[0] = alice[0] - bob[2];
    resup[1] = alice[1] - bob[0];
    resup[2] = alice[2] - bob[1];
    f();
    int w = n / 2;
    if (n & 1) w++;
    if (cnt >= w) {
      printf("YES\n");
      for (int i = 0; i < v.size(); i++) printf("%c", v[i]);
      printf("\n");
    } else
      printf("NO\n");
  }
  return 0;
}
