func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long UNDEF = -1;   const long long INF = 1e18;   template <typename T>   inline bool chkmax(T& aa, T bb) {     return aa < bb ? aa = bb, true : false;   }   template <typename T>   inline bool chkmin(T& aa, T bb) {     return aa > bb ? aa = bb, true : false;   }   static char stdinBuffer[1024];   static char* stdinDataEnd = stdinBuffer + sizeof(stdinBuffer);   static const char* stdinPos = stdinDataEnd;   void readAhead(size_t amount) {     size_t remaining = stdinDataEnd - stdinPos;     if (remaining < amount) {       memmove(stdinBuffer, stdinPos, remaining);       size_t sz = fread(stdinBuffer + remaining, 1,                         sizeof(stdinBuffer) - remaining, stdin);       stdinPos = stdinBuffer;       stdinDataEnd = stdinBuffer + remaining + sz;       if (stdinDataEnd != stdinBuffer + sizeof(stdinBuffer)) *stdinDataEnd = 0;     }   }   int rint() {     readAhead(16);     int x = 0;     bool neg = false;     while (*stdinPos ==     || *stdinPos ==   n ) ++stdinPos;     if (*stdinPos ==  - ) {       ++stdinPos;       neg = true;     }     while (*stdinPos >=  0  && *stdinPos <=  9 ) {       x *= 10;       x += *stdinPos -  0 ;       ++stdinPos;     }     return neg ? -x : x;   }   char rch() {     readAhead(16);     while (*stdinPos ==     || *stdinPos ==   n ) ++stdinPos;     char ans = *stdinPos;     ++stdinPos;     return ans;   }   long long rlong() {     readAhead(32);     long long x = 0;     bool neg = false;     while (*stdinPos ==     || *stdinPos ==   n ) ++stdinPos;     if (*stdinPos ==  - ) {       ++stdinPos;       neg = true;     }     while (*stdinPos >=  0  && *stdinPos <=  9 ) {       x *= 10;       x += *stdinPos -  0 ;       ++stdinPos;     }     return neg ? -x : x;   }   const int mc = 26, mn = 1e6 + 4;   char s[mn], t[mn];   int sc[mc + 1], tc[mc + 1], wc[mc + 1];   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     scanf( %s n%s n , s, t);     int sl = strlen(s), tl = strlen(t);     int q = 0;     for (int i = 0; i < sl; i++) {       if (s[i] !=  ? )         sc[s[i] -  a ]++;       else         q++;     }     for (int i = 0; i < tl; i++) {       tc[t[i] -  a ]++;     }     int imin = 0, imax = mn;     while (imin < imax) {       int imid = (imin + imax) >> 1;       long long need = 0;       for (int c = 0; c < 26; c++) {         long long want = (tc[c] * (long long)imid) - sc[c];         if (want >= 0) need += want;       }       if (need <= q)         imin = imid + 1;       else         imax = imid;     }     imin--;     for (int c = 0; c < 26; c++) {       wc[c] = tc[c] * imin - sc[c];     }     int cidx = 0;     for (int i = 0; i < sl; i++) {       if (s[i] ==  ? ) {         while (cidx < mc && wc[cidx] <= 0) cidx++;         if (cidx < mc) {           s[i] =  a  + cidx;           wc[cidx]--;         } else {           s[i] =  a ;         }       }     }     printf( %s n , s);   }   