#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, rock = 0, peper = 0, sec = 0, de = 0;
    cin >> n;
    cin >> rock >> peper >> sec;
    string s, ans;
    cin >> s;
    for (long long int i = 0; i < n; i++) {
      if (s[i] == 'R' && peper > 0) {
        ans = ans + 'P';
        peper--;
        de++;
        continue;
      } else if (s[i] == 'P' && sec > 0) {
        sec--;
        ans = ans + 'S';
        de++;
        continue;
      } else if (s[i] == 'S' && rock > 0) {
        rock--;
        ans = ans + 'R';
        de++;
        continue;
      } else {
        ans = ans + '1';
      }
    }
    for (long long int i = 0; i < n; i++) {
      if (ans[i] == '1') {
        if (rock > 0) {
          ans[i] = 'R';
          rock--;
        } else if (peper > 0) {
          ans[i] = 'P';
          peper--;
        } else if (sec > 0) {
          sec--;
          ans[i] = 'S';
        }
      }
    }
    if (n % 2 == 0)
      n = n / 2;
    else
      n = (n + 1) / 2;
    if (de >= n) {
      cout << "YES"
           << "\n";
      cout << ans << "\n";
    } else
      cout << "NO"
           << "\n";
  }
}
