func_code_string: #include <bits/stdc++.h>   #pragma GCC target( sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native )   #pragma GCC optimize( unroll-loops )   #pragma GCC optimize( Ofast )   #pragma GCC optimize( O3 )   #pragma GCC target( avx )   const long long MOD = 1000000007;   const long double PI = 3.1415926535898;   const long long LIM = 100005;   using namespace std;   long long fpow(long long x, long long y) {     long long temp;     if (y == 0) return 1;     temp = fpow(x, y / 2);     if (y % 2 == 0)       return temp * temp;     else       return x * temp * temp;   }   long long gcd(long long a, long long b) {     if (b == 0) return a;     return gcd(b, a % b);   }   void sieve(long long n) {     bool prime[5 * LIM];     memset(prime, true, sizeof(prime));     for (long long p = 2; p * p <= n; p++)       if (prime[p] == true)         for (long long i = p * p; i <= n; i += p) prime[i] = false;     prime[1] = 0;   }   inline long long read() {     long long p = 1, ans = 0;     char ch = getchar();     while (ch < 48 || ch > 57) {       if (ch ==  - ) p = -1;       ch = getchar();     }     while (ch >= 48 && ch <= 57) {       ans = (ans << 3) + (ans << 1) + ch - 48;       ch = getchar();     }     return ans * p;   }   bool isPrime(long long n) {     if (n <= 1) return false;     if (n <= 3) return true;     if (n % 2 == 0 || n % 3 == 0) return false;     for (long long i = 5; i * i <= n; i = i + 6)       if (n % i == 0 || n % (i + 2) == 0) return false;     return true;   }   map<long long, long long> primeFactors(long long n) {     map<long long, long long> make_pair;     while (n % 2 == 0) {       if (make_pair.count(2) == 1)         make_pair[2]++;       else         make_pair.insert({2, 1});       n = n / 2;     }     for (long long i = 3; i <= sqrt(n); i = i + 2) {       while (n % i == 0) {         if (make_pair.count(i) == 1)           make_pair[i]++;         else           make_pair.insert({i, 1});         n = n / i;       }     }     if (n > 2) {       if (make_pair.count(n) == 1)         make_pair[n]++;       else         make_pair.insert({n, 1});     }     return make_pair;   }   long long compare(string a, string b) {     if (a.empty()) return 0;     for (long long i = 0; i < a.length(); i++) {       if (a[i] > b[i])         return 1;       else if (a[i] < b[i])         return -1;     }     return 0;   }   bool isPalindrome(string str) {     long long l = 0;     long long h = str.length() - 1;     while (h > l) {       if (str[l++] != str[h--]) {         return false;       }     }     return true;   }   long long maxSum(vector<long long> a) {     long long max_so_far = a[0];     long long curr_max = a[0];     for (long long i = 1; i < a.size(); i++) {       curr_max = max(a[i], curr_max + a[i]);       max_so_far = max(max_so_far, curr_max);     }     return max_so_far;   }   long long maxlength(vector<long long> a) {     long long size = a.size();     long long max_so_far = INT_MIN, max_ending_here = 0, start = 0, end = 0,               s = 0;     for (long long i = 0; i < size; i++) {       max_ending_here += a[i];       if (max_so_far < max_ending_here) {         max_so_far = max_ending_here;         start = s;         end = i;       }       if (max_ending_here <= 0) {         max_ending_here = 0;         s = i + 1;       }     }     return (end - start + 1);   }   int32_t main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     long long t;     cin >> t;     for (long long tt = 1; tt <= t; ++tt) {       long long n, r, p, s, cnt = 0;       cin >> n >> r >> p >> s;       string str;       cin >> str;       vector<char> ans(n,  A );       for (long long i = 0; i < str.length(); i++) {         if (str[i] ==  R  && p > 0) {           ans[i] =  P ;           cnt++;           p--;         }         if (str[i] ==  P  && s > 0) {           ans[i] =  S ;           cnt++;           s--;         }         if (str[i] ==  S  && r > 0) {           ans[i] =  R ;           cnt++;           r--;         }       }       if (cnt < ceil(n / 2.0))         cout <<  NO               <<   n ;       else {         cout <<  YES               <<   n ;         for (long long i = 0; i < n; i++) {           if (ans[i] ==  A ) {             if (p > 0) {               ans[i] =  P ;               p--;             } else if (r > 0) {               ans[i] =  R ;               r--;             } else if (s > 0) {               ans[i] =  S ;               s--;             }           }           cout << ans[i];         }         cout <<   n ;       }     }     return 0;   }   