#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  char node[100005];
  char t[100005];
  char min = 'z';
  char max = 'a';
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> node[i];
    t[i] = node[i];
    if (min > node[i]) min = node[i];
    if (max < node[i]) max = node[i];
  }
  sort(t, t + n);
  if (k > n) {
    for (int i = 0; i < n; i++) {
      cout << node[i];
    }
    for (int j = 0; j < k - n; j++) {
      cout << min;
    }
    cout << endl;
  } else {
    int i;
    for (i = k - 1; i >= 0; i--) {
      if (node[i] != max) {
        break;
      }
    }
    char x;
    for (int j = 0; j < n; j++) {
      if (t[j] > node[i]) {
        x = t[j];
        break;
      }
    }
    for (int p = 0; p < i; p++) {
      cout << node[p];
    }
    cout << x;
    for (int q = i + 1; q < k; q++) {
      cout << min;
    }
    cout << endl;
  }
  return 0;
}
