#include <bits/stdc++.h>
using namespace std;
int t, n, a, b, c, ans, draw;
char tmp, res[110];
int main() {
  cin >> t;
  while (t--) {
    cin >> n >> a >> b >> c;
    ans = 0;
    for (int i = 1; i <= n; i++) {
      cin >> tmp;
      if (tmp == 'S' && a > 0) {
        res[i] = 'R';
        ans++;
        a--;
      } else if (tmp == 'R' && b > 0) {
        res[i] = 'P';
        ans++;
        b--;
      } else if (tmp == 'P' && c > 0) {
        res[i] = 'S';
        ans++;
        c--;
      } else
        res[i] = '1';
    }
    if (ans >= n / 2 + ((n % 2) ? 1 : 0)) {
      cout << "YES\n";
      for (int i = 1; i <= n; i++)
        if (res[i] == '1') {
          if (a > 0) {
            cout << 'R';
            a--;
          } else if (b > 0) {
            cout << 'P';
            b--;
          } else if (c > 0) {
            cout << 'S';
            c--;
          }
        } else
          cout << res[i];
      cout << endl;
    } else
      cout << "NO\n";
  }
}
