#include <bits/stdc++.h>
using namespace std;
const int __precision = 13;
using ll = long long;
ll solve(ll n, ll k, ll A, ll B) {
  if (n < k) return (n - 1) * A;
  ll rem = n % k;
  return min((n - 1) * A, rem * A + B + solve(n / k, k, A, B));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(__precision);
  cout.setf(ios_base::fixed);
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  set<char> st(s.begin(), s.end());
  string ans = s.substr(0, k);
  if (k <= n) {
    bool change = true;
    int cur = k - 1;
    while (change) {
      auto c = st.upper_bound(ans[cur]);
      if (c != st.end()) {
        ans[cur] = *c;
        for (int i = cur + 1; i < k; ++i) ans[i] = *st.begin();
        change = false;
      }
      --cur;
    }
  } else {
    while (ans.size() < k) {
      ans.push_back(*st.begin());
    }
  }
  cout << ans;
  return 0;
}
