#include <bits/stdc++.h>
using namespace std;
char a[200020];
map<char, int> ma;
int main() {
  int n, m, mrk;
  cin >> n >> m;
  char p, mn = 'z', ch;
  mrk = n;
  for (int i = 1; i <= n; i++)
    cin >> ch, a[i] = ch, ma[ch] = 1, mn = min(mn, a[i]);
  if (m > n) {
    for (int i = 1; i <= n; i++) cout << a[i];
    for (int i = n + 1; i <= m; i++) cout << mn;
    return 0;
  }
  for (int i = m; i >= 1; i--) {
    char c = a[i];
    bool k = 0;
    for (char j = c; j <= 'z'; j++)
      if (j != c && ma[j]) {
        mrk = i;
        p = j, k = 1;
        break;
      }
    if (k) break;
  }
  for (int i = 1; i <= mrk - 1; i++) cout << a[i];
  cout << p;
  for (int i = mrk + 1; i <= m; i++) cout << mn;
}
