#include <bits/stdc++.h>
using namespace std;
int main() {
  int test;
  cin >> test;
  while (test--) {
    int n;
    cin >> n;
    int a, b, c;
    cin >> a >> b >> c;
    string str;
    cin >> str;
    string ans;
    ans.resize(n);
    int num_win(0);
    for (int i = 0; i < n; ++i) {
      if (str[i] == 'R') {
        if (b > 0) {
          ans[i] = 'P';
          b--;
          num_win++;
        } else {
          ans[i] = '_';
        }
      } else if (str[i] == 'P') {
        if (c > 0) {
          ans[i] = 'S';
          c--;
          num_win++;
        } else {
          ans[i] = '_';
        }
      } else {
        if (a > 0) {
          ans[i] = 'R';
          a--;
          num_win++;
        } else {
          ans[i] = '_';
        }
      }
    }
    if (num_win * 2 < n) {
      cout << "NO" << endl;
      continue;
    }
    cout << "YES" << endl;
    for (int i = 0; i < n; ++i) {
      if (ans[i] == '_') {
        if (a > 0) {
          ans[i] = 'R';
          a--;
        } else if (b > 0) {
          ans[i] = 'P';
          b--;
        } else {
          ans[i] = 'S';
          c--;
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}
