#include <bits/stdc++.h>
using namespace std;
long long int arr[100005];
long long int l1[100005];
long long int l2[100005];
long long int d[100005];
long long int e[100005];
long long int tree[100005];
long long int tree2[100005];
void update(long long int idx, long long int val, long long int n) {
  while (idx <= n) {
    tree[idx] += val;
    idx += (idx & -idx);
  }
}
long long int read(long long int idx) {
  long long int sum = 0;
  while (idx > 0) {
    sum += tree[idx];
    idx -= (idx & -idx);
  }
  return sum;
}
void update2(long long int idx, long long int val, long long int n) {
  while (idx <= n) {
    tree2[idx] += val;
    idx += (idx & -idx);
  }
}
long long int read2(long long int idx) {
  long long int sum = 0;
  while (idx > 0) {
    sum += tree2[idx];
    idx -= (idx & -idx);
  }
  return sum;
}
int corona(int x, int y) {
  long long int s = 0, s1, s2;
  for (int i = x + 1; i <= y; i++) {
    if (l1[i] < l1[i - 1]) {
      s++;
      break;
    }
  }
  if (s == 0)
    return abs(y - x) + 1;
  else {
    s1 = corona(x, (x + y) / 2);
    s2 = corona(((x + y) / 2) + 1, y);
    return max(s1, s2);
  }
}
int main() {
  long long int n, a, q, b, t, c, m, k, x, y, x3 = 0, x4 = 0, x5 = 0;
  string s3, s4;
  cin >> t;
  while (t--) {
    cin >> n >> a >> b >> c;
    cin >> s3;
    for (int i = 0; i < s3.size(); i++) {
      if (s3[i] == 'R') {
        if (b > 0) {
          b--;
          x3++;
          l1[i] = 'P';
        }
      } else if (s3[i] == 'P') {
        if (c > 0) {
          c--;
          x3++;
          l1[i] = 'S';
        }
      } else if (s3[i] == 'S') {
        if (a > 0) {
          a--;
          x3++;
          l1[i] = 'R';
        }
      }
    }
    if (x3 >= ceil(n / 2.0)) {
      cout << "YES\n";
      for (int i = 0; i < s3.size(); i++) {
        if (l1[i] == 0 && a > 0) {
          l1[i] = 'R';
          a--;
        } else if (l1[i] == 0 && b > 0) {
          l1[i] = 'P';
          b--;
        } else if (l1[i] == 0 && c > 0) {
          l1[i] = 'S';
          c--;
        }
        s4 += (char)l1[i];
      }
      cout << s4 << endl;
    } else
      cout << "NO\n";
    x3 = 0;
    s4 = "";
    memset(l1, 0, sizeof l1);
  }
  return 0;
}
