#include <bits/stdc++.h>
using namespace std;
int a[100001];
int main() {
  int n, k, ma = 0, mi = INT_MAX, kq = INT_MAX, dd;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    char b;
    cin >> b;
    a[i] = b - 'a';
    mi = min(mi, a[i]);
  }
  for (int i = 1; i <= n; ++i) {
    ma = max(ma, a[i]);
  }
  if (n >= k) {
    for (int i = k; i >= 1; --i) {
      int tt = 0;
      if (a[i] != ma)
        for (int j = 1; j <= n; ++j)
          if (a[j] > a[i]) {
            kq = min(kq, a[j]);
            dd = i;
            tt = 1;
          }
      if (tt == 1) break;
    }
    for (int i = 1; i <= k; ++i) {
      string x;
      if (i < dd) x = (a[i] + 'a');
      if (i == dd) x = (kq + 'a');
      if (i > dd) x = (mi + 'a');
      cout << x;
    }
  } else
    for (int i = 1; i <= n; ++i) {
      string x;
      x = (a[i] + 'a');
      cout << x;
    }
  for (int i = 1; i <= k - n; ++i) {
    string x;
    x = (mi + 'a');
    cout << x;
  }
}
