func_code_string: #include <bits/stdc++.h>   using namespace std;   const int mod = 1000000007;   int n, m, i, j, k, l, a, b, sz[2], v1[2][5005];   string s;   bool used[5005];   int main() {     ios_base ::sync_with_stdio();     cin.tie(0);     cin >> s;     n = s.size();     if (n == 1) {       cout << s;       return 0;     }     int pw = 1;     while (pw * 2 <= n) pw *= 2, k++;     a = 0;     b = 1;     v1[a][0] = 0;     sz[a] = 1;     for (l = 0; l < n - (1 << k) + 1; l++) {       char res =  z ;       int v, mask;       for (i = 0; i < sz[a]; i++) {         int v = v1[a][i], mask = ((1 << k) - 1) ^ (v - l);         used[v] = 0;         for (j = mask; j > 0; j = mask & (j - 1)) res = min(res, s[v + j]);         res = min(res, s[v]);       }       for (i = 0; i < sz[a]; i++) {         int v = v1[a][i], mask = ((1 << k) - 1) ^ (v - l);         for (j = mask; j >= 0; j = mask & (j - 1)) {           if (!used[v + j + 1] && s[v + j] == res)             v1[b][sz[b]++] = v + j + 1, used[v + j + 1] = true;           if (j == 0) break;         }       }       cout << res;       sz[a] = 0;       b = a;       a ^= 1;     }     return 0;   }   