#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const long long INF = mod * mod;
const long double eps = 1e-5;
void solve() {
  int n, k;
  string s;
  cin >> n >> k >> s;
  long long d = k / 2;
  int mi = 100;
  for (int i = 0; i < n; i++) {
    mi = min(mi, s[i] - 'a');
  }
  string ansg = s;
  int mlen = 0;
  if (k > 28) {
    for (int i = 0; i < n; i++) {
      cout << char('a' + mi);
    }
    cout << endl;
    return;
  }
  for (int i = 0; i < n; i++) {
    int le = i;
    while (i + 1 < n && s[i] == s[i + 1]) i++;
    if (s[i] - 'a' != mi) continue;
    int len = i - le + 1;
    if (i == n - 1) {
      long long tim = (1 << k);
      if (tim * len >= n) {
        for (int j = 0; j < n; j++) {
          cout << char('a' + mi);
        }
        cout << endl;
        return;
      }
      string nex;
      for (int j = 0; j < tim * len; j++) {
        nex.push_back('a' + mi);
      }
      int cur = le - 1;
      while (nex.size() < n) {
        nex.push_back(s[cur]);
        cur--;
      }
      ansg = min(ansg, nex);
    } else {
      long long tim = (1 << d);
      if (tim * len > n) {
        for (int j = 0; j < n; j++) {
          cout << char('a' + mi);
        }
        cout << endl;
        return;
      }
      string c;
      for (int j = 0; j < tim * len; j++) {
        c.push_back('a' + mi);
      }
      int cur = i + 1;
      while (c.size() < n) {
        int id = cur;
        if (cur >= n) id = 2 * n - 1 - cur;
        c.push_back(s[id]);
        cur++;
      }
      ansg = min(ansg, c);
    }
  }
  cout << ansg << endl;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
