#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, r, p, s, ans = 0;
    cin >> n >> r >> p >> s;
    char b[n], a[n];
    for (int i = 0; i < n; i++) {
      cin >> b[i];
      a[i] = 0;
      if (b[i] == 'R' && p)
        a[i] = 'P', p--;
      else if (b[i] == 'P' && s)
        a[i] = 'S', s--;
      else if (b[i] == 'S' && r)
        a[i] = 'R', r--;
    }
    for (int i = 0; i < n; i++) {
      if (!a[i]) {
        if (b[i] == 'R' && r)
          a[i] = 'R', r--;
        else if (b[i] == 'P' && p)
          a[i] = 'P', p--;
        else if (b[i] == 'S' && s)
          a[i] = 'S', s--;
      }
    }
    for (int i = 0; i < n; i++) {
      if (!a[i]) {
        if (r)
          a[i] = 'R', r--;
        else if (p)
          a[i] = 'P', p--;
        else
          a[i] = 'S', s--;
      }
    }
    for (int i = 0; i < n; i++)
      if ((a[i] == 'R' && b[i] == 'S') || (a[i] == 'P' && b[i] == 'R') ||
          (a[i] == 'S' && b[i] == 'P'))
        ans++;
    if (ans >= (n + 1) / 2) {
      cout << "Yes\n";
      for (int i = 0; i < n; i++) cout << a[i];
      cout << '\n';
    } else
      cout << "No\n";
  }
  return 0;
}
