#include <bits/stdc++.h>
const long double eps = 0.00000001;
const long long MOD = 1e9 + 7;
using namespace std;
long long ans;
bool b;
string second, t;
int main() {
  fflush(stdin);
  cout << fixed, cout.precision(18);
  ios_base::sync_with_stdio(false);
  int i, j, n, m;
  cin >> n >> m >> second;
  set<char> se;
  for (i = 0; i < n; ++i) se.insert(second[i]);
  if (m <= n) {
    for (i = 0; i < m - 1; ++i) t += second[i];
    int cur = m - 1;
    while (1) {
      auto it = se.upper_bound(second[cur]);
      if (it == se.end())
        --cur, t.pop_back();
      else {
        t += (*it);
        break;
      }
    }
    while (t.size() < m) t += (*se.begin());
  } else {
    t = second;
    auto it = se.begin();
    for (i = n; i < m; ++i) t += (*it);
  }
  cout << t;
}
