func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, k;   int mi = 0, ma = 25;   bool exist[26];   char str[100005];   inline void init() {     scanf( %d%d , &n, &k);     memset(exist, false, sizeof(exist));     scanf( %s , str + 1);   }   inline void solve() {     for (int i = 1; i <= n; i++) exist[str[i] -  a ] = true;     for (mi = 0; !exist[mi]; mi++)       ;     for (ma = 25; !exist[ma]; ma--)       ;     if (n < k) {       printf( %s , str + 1);       for (int i = n + 1; i <= k; i++) putchar(mi +  a );       return;     }     int p;     for (p = k; p && str[p] == ma +  a ; p--)       ;     str[p]++;     while (!exist[str[p] -  a ]) str[p]++;     for (p = p + 1; p <= k; p++) str[p] = mi +  a ;     str[k + 1] = 0;     puts(str + 1);   }   int main() {     init();     solve();     return 0;   }   