func_code_string: #include <bits/stdc++.h>   using namespace std;   char s[110], ss[110];   int a[210], ans[210], n, k, namlen;   bool boo;   bool check() {     int i, j;     for (i = 1; i <= n; i++)       if (ss[i] ==  0 ) {         bool bk = true;         for (j = 1; j <= namlen; j++)           if (a[i + j - 1] != s[j]) {             bk = false;             break;           }         if (bk) return false;       }     return true;   }   void search(int x) {     if (x == n + 1) {       if (check()) {         for (int i = 1; i <= n; i++) ans[i] = a[i];         boo = true;       }       return;     }     if (ss[x] ==  1 ) {       search(x + 1);       return;     }     if (a[x] != 0) {       search(x + 1);       return;     }     for (int i = 0; i < k; i++) {       a[x] = i +  a ;       search(x + 1);       if (boo) return;     }   }   int main() {     int len, i, j;     scanf( %d%d , &n, &k);     getchar();     gets(s + 1);     gets(ss + 1);     namlen = strlen(s + 1);     len = strlen(ss + 1);     for (i = 1; i <= namlen; i++)       if (s[i] -  a  + 1 > k) {         printf( No solution n );         return 0;       }     bool bk = true;     for (i = 1; i <= n; i++) a[0] = 0;     for (i = 1; i <= len; i++) {       if (ss[i] ==  1 ) {         if (i + namlen - 1 > n) {           bk = false;           break;         }         for (j = 1; j <= namlen; j++) {           if (a[i + j - 1] != 0 && a[i + j - 1] != s[j]) {             bk = false;             break;           }           a[i + j - 1] = s[j];         }         if (!bk) break;       }     }     if (!bk) {       printf( No solution n );       return 0;     }     boo = false;     search(1);     if (!boo)       printf( No solution n );     else {       for (i = 1; i <= n; i++) printf( %c , char(ans[i]));       printf(  n );     }     return 0;   }   