func_code_string: #include <bits/stdc++.h>   using namespace std;   struct Pair {     long long f, s;     Pair() { f = s = 0; }     Pair(long long f, long long s) {       this->f = f;       this->s = s;     }   };   const int maxn = 36 + 100;   Pair d[maxn][maxn];   int pr[maxn][maxn];   long long _10(int);   void print(int, int);   int main() {     int n;     string str;     cin >> n >> str;     for (int i = 0; i <= n; i++)       for (int j = 0; j <= n; j++) {         if (i) {           pr[i][j] = 1;           d[i][j].f = d[i - 1][j].f + _10(n - i) * (str[i + j - 1] -  0 );           d[i][j].s = d[i - 1][j].s;         }         if (j) {           if (d[i][j].f + d[i][j].s < d[i][j - 1].f + d[i][j - 1].s +                                           _10(n - j) * (str[i + j - 1] -  0 )) {             pr[i][j] = 0;             d[i][j].f = d[i][j - 1].f;             d[i][j].s = d[i][j - 1].s + _10(n - j) * (str[i + j - 1] -  0 );           }         }       }     print(n, n);     cout << endl;   }   long long _10(int k) {     long long res = 1;     while (k--) res *= 10;     return res;   }   void print(int i, int j) {     if (!i && !j) return;     if (pr[i][j]) {       print(i - 1, j);       cout <<  H ;       return;     }     print(i, j - 1);     cout <<  M ;   }   