#include <bits/stdc++.h>
using namespace std;
int pull(int &a, int &b, int &c) {
  if (a > 0) {
    a--;
    return 0;
  } else if (b > 0) {
    b--;
    return 1;
  } else {
    c--;
    return 2;
  }
}
char converty(int num) {
  if (num == 1)
    return 'P';
  else if (num == 0)
    return 'R';
  else
    return 'S';
}
int main() {
  int t, n;
  int a, b, c;
  cin >> t;
  vector<int> eee(100);
  for (int i = 0; i < t; i++) {
    cin >> n;
    int yyy = 1;
    cin >> a >> b >> c;
    vector<int> vis(n, -1);
    for (int j = 0; j < n; j++) {
      char symbol;
      cin >> symbol;
      yyy++;
      if (symbol == 'P') {
        if (c > 0) {
          c--;
          vis[j] = 2;
        }
      } else if (symbol == 'R') {
        if (b > 0) {
          b--;
          vis[j] = 1;
        }
      } else if (symbol == 'S') {
        if (a > 0) {
          a--;
          vis[j] = 0;
        }
      }
    }
    if (2 * (a + b + c) > n) {
      cout << "NO";
    } else {
      cout << "YES" << endl;
      for (int j = 0; j < n; ++j) {
        if (vis[j] == -1) {
          cout << converty(pull(a, b, c));
        } else {
          cout << converty(vis[j]);
        }
      }
    }
    cout << endl;
  }
}
