#include <bits/stdc++.h>
using namespace std;
void solve(int t) {
  while (t--) {
    int n, a, b, c;
    string str, ans;
    int flag = 0;
    scanf("%d%d%d%d", &n, &a, &b, &c);
    cin >> str;
    ans = str;
    for (int i = 0; i < n; i++) {
      ans[i] = '?';
      if (str[i] == 'R' && b > 0) --b, ans[i] = 'P', ++flag;
      if (str[i] == 'P' && c > 0) --c, ans[i] = 'S', ++flag;
      if (str[i] == 'S' && a > 0) --a, ans[i] = 'R', ++flag;
    }
    if (flag < (n + 1) / 2) {
      puts("NO");
      continue;
    } else {
      for (int i = 0; i < n; i++) {
        if (ans[i] != '?') continue;
        if (a)
          ans[i] = 'R', --a;
        else if (b)
          ans[i] = 'P', --b;
        else if (c)
          ans[i] = 'S', --c;
      }
      puts("YES");
      cout << ans << endl;
    }
  }
  return;
}
int main() {
  int t;
  scanf("%d", &t);
  solve(t);
}
