#include <bits/stdc++.h>
using namespace std;
char s[101000], t[101000];
int n, k, mx, mn, fl[233];
int main() {
  cin >> n >> k >> s + 1;
  mx = 0, mn = 233;
  for (int i = 1; i <= n; ++i) {
    mx = max(mx, (int)s[i]);
    mn = min(mn, (int)s[i]);
    fl[s[i]] = 1;
  }
  if (n < k) {
    cout << s + 1;
    for (int i = n + 1; i <= k; ++i) printf("%c", mn);
    return 0;
  }
  for (int p = k;; --p)
    if (s[p] != mx) {
      ++s[p];
      for (; !fl[s[p]]; ++s[p])
        ;
      for (int i = 1; i <= p; ++i) printf("%c", s[i]);
      for (int i = p + 1; i <= k; ++i) printf("%c", mn);
      return 0;
    }
}
