func_code_string: #include <bits/stdc++.h>   using namespace std;   int I, len[500005], las[500005];   string second, ans[500005];   char fi[500005], se[500005];   string get(int raod, char c, int ind) {     len[I] = raod + len[ind];     raod = min(raod, 10);     string ret =   ;     for (int i = 0; i < raod; i++) ret += c;     ret = ret + ans[ind];     if (ret.size() <= 10) return ret;     string ne;     for (int i = 0; i < 5; i++) ne += ret[i];     ne +=  ... ;     for (int i = (int)ret.size() - 2; i < ret.size(); i++) ne += ret[i];     return ne;   }   int main() {     ios::sync_with_stdio(false);     cin >> second;     int n = (int)second.size();     ans[n - 1] += second[n - 1];     len[n - 1] = 1;     las[n - 1] = n;     fi[n - 1] = second[n - 1];     se[n - 1] =  % ;     fi[n] =  % ;     se[n] =  % ;     for (int i = (int)second.size() - 2; i >= 0; i--) {       I = i;       int raod;       if (second[i] == second[i + 1]) {         las[i] = las[i + 1];       } else {         las[i] = i + 1;       }       int ind = las[i];       if (fi[ind] ==  % ) {         raod = (ind - i) % 2;         ans[i] = get(raod, second[i], ind);         if (raod) {           fi[i] = second[i];         } else           fi[i] =  % ;         se[i] =  % ;         continue;       }       if (fi[ind] == second[i]) {         if (se[ind] ==  % ) {           raod = (ind - i) % 2;           ans[i] = get(raod, second[i], ind);           fi[i] = second[i];           se[i] =  % ;           continue;         } else {           if (se[ind] > second[i]) {             ans[i] = get(ind - i, second[i], ind);             fi[i] = second[i];             se[i] = se[ind];           } else {             raod = (ind - i) % 2;             ans[i] = get(raod, second[i], ind);             fi[i] = second[i];             se[i] = se[i];           }         }       } else {         if (fi[ind] > second[i]) {           ans[i] = get(ind - i, second[i], ind);           fi[i] = second[i];           se[i] = fi[ind];         } else {           raod = (ind - i) % 2;           ans[i] = get(raod, second[i], ind);           if (raod) {             fi[i] = second[i];             se[i] = fi[ind];           } else {             fi[i] = fi[ind];             se[i] = se[ind];           }         }       }     }     for (int i = 0; i < n; i++) cout << len[i] <<     << ans[i] <<   n ;     return 0;   }   