#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, cd = 0;
  cin >> n >> k;
  string cad = "", aux, aux2;
  cin >> cad;
  aux = cad;
  aux2 = cad;
  set<int> st;
  set<int>::iterator it;
  sort(aux.begin(), aux.end());
  char Min = aux[0];
  for (int i = 0; i < cad.size(); ++i) {
    st.insert(cad[i]);
  }
  if (cad.size() < k) {
    for (int i = cad.size(); i <= k; ++i) {
      cad = cad + Min;
    }
  }
  if (k <= n) {
    int index = 0;
    for (int i = k - 1; i >= 0; --i) {
      it = upper_bound(st.begin(), st.end(), cad[i]);
      char x = *it;
      if (x > cad[i]) {
        cad[i] = x;
        index = i;
        break;
      }
    }
    for (int i = 0; i < k; ++i) {
      if (i <= index) {
        cout << cad[i];
      } else
        cout << Min;
    }
    cout << "\n";
  } else {
    for (int i = 0; i < k; ++i) {
      cout << cad[i];
    }
    cout << "\n";
  }
  return 0;
}
