#include <bits/stdc++.h>
using namespace std;
int n, rock, paper, scissors;
char s[105], ans[105];
int win;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    scanf("%d\n%d %d %d\n%s", &n, &rock, &paper, &scissors, s + 1);
    win = 0;
    memset(ans, 0, sizeof(ans));
    for (int i = 1; i <= n; i++) switch (s[i]) {
        case 'R':
          if (paper) paper--, win++, ans[i] = 'P';
          break;
        case 'P':
          if (scissors) scissors--, win++, ans[i] = 'S';
          break;
        case 'S':
          if (rock) rock--, win++, ans[i] = 'R';
          break;
      }
    if (win < (n + 1) / 2) {
      puts("NO");
      continue;
    }
    puts("YES");
    for (int i = 1; i <= n; i++) {
      if (ans[i]) continue;
      if (rock)
        rock--, ans[i] = 'R';
      else if (paper)
        paper--, ans[i] = 'P';
      else
        scissors--, ans[i] = 'S';
    }
    puts(ans + 1);
  }
}
