#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  vector<char> s(n);
  set<char> a;
  for (long long i = 0; i < n; i++) {
    cin >> s[i];
    a.insert(s[i]);
  }
  vector<char> snew(a.begin(), a.end());
  sort(snew.begin(), snew.end());
  long long l = snew.size();
  vector<char> t(k, snew[0]);
  for (long long i = 0; i < min(k, n); i++) {
    t[i] = s[i];
  }
  if (k > n) {
    for (long long i = 0; i < k; i++) cout << t[i];
    return 0;
  }
  t[k - 1] =
      snew[(find(snew.begin(), snew.end(), t[k - 1]) - snew.begin() + 1) % l];
  for (long long i = k - 1; t[i] < s[i] && i > 0; i--) {
    t[i - 1] =
        snew[(find(snew.begin(), snew.end(), t[i - 1]) - snew.begin() + 1) % l];
  }
  for (long long i = 0; i < k; i++) cout << t[i];
  cout << endl;
  return 0;
}
