#include <bits/stdc++.h>
using namespace std;
const int N = 1234567;
long long int mpow(long long int a, long long int b) {
  if (b == 0)
    return 1;
  else if (b % 2 == 0) {
    long long int memo = mpow(a, b / 2);
    return memo * memo % (long long int)(1e9 + 7);
  } else
    return mpow(a, b - 1) * a % (long long int)(1e9 + 7);
}
long long int gcd(long long int a, long long int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
vector<long long int> kaijo_memo;
long long int kaijo(long long int n) {
  if (kaijo_memo.size() > n) return kaijo_memo[n];
  if (kaijo_memo.size() == 0) kaijo_memo.push_back(1);
  while (kaijo_memo.size() <= n)
    kaijo_memo.push_back(kaijo_memo[kaijo_memo.size() - 1] * kaijo_memo.size() %
                         (long long int)(1e9 + 7));
  return kaijo_memo[n];
}
long long int nCr(long long int n, long long int r) {
  if (n < r || r < 0) return 0;
  long long int ret = 1;
  ret *= kaijo(n);
  ret %= (long long int)(1e9 + 7);
  ret *= mpow(kaijo(r), (long long int)(1e9 + 7) - 2);
  ret %= (long long int)(1e9 + 7);
  ret *= mpow(kaijo(n - r), (long long int)(1e9 + 7) - 2);
  ret %= (long long int)(1e9 + 7);
  return ret;
}
int s_pow(int a, int b) {
  if (b >= 20) {
    return 10000;
  } else {
    return pow(a, b);
  }
}
int main(void) {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  string s_;
  s_ = s;
  sort(s_.begin(), s_.end());
  char waka = s_[0];
  int renzoku = 0;
  int count = 0;
  for (int i = 0; i < (int)(s.size()); i++) {
    if (s[i] == waka) {
      count++;
    } else {
      renzoku = max(renzoku, count);
      count = 0;
    }
  }
  if (count != 0) {
    renzoku = max(renzoku, count * 2);
  }
  vector<int> kouho;
  vector<int> houkou;
  for (int i = 0; i < (int)(s.size()); i++) {
    if (s[i] == waka) {
      count = 0;
      int memo = i;
      while (i < s.size() && s[i] == waka) {
        count++;
        i++;
      }
      if (i == s.size()) {
        if (count * 2 == renzoku) {
          kouho.push_back(memo - 1);
          houkou.push_back(-1);
        }
      } else {
        if (count == renzoku) {
          if (memo - 1 >= 0 && k != 1) {
            kouho.push_back(memo - 1);
            houkou.push_back(-1);
          }
          kouho.push_back(i);
          houkou.push_back(1);
        }
      }
    }
  }
  renzoku *= s_pow(2, k - 1);
  if (renzoku >= n) {
    for (int i = 0; i < (int)(n); i++) {
      cout << waka;
    }
    cout << endl;
    return 0;
  }
  vector<string> ans_kouho;
  for (int i = 0; i < (int)(kouho.size()); i++) {
    int si = kouho[i];
    string moji = "";
    int count = 0;
    int nexti;
    if (houkou[i] > 0) {
      while (moji.size() < n && si < s.size()) {
        if (count < renzoku) {
          moji.push_back(waka);
          count++;
          continue;
        } else {
          moji.push_back(s[si]);
          si++;
        }
      }
      si--;
      while (moji.size() < n && si >= 0) {
        if (count < renzoku) {
          moji.push_back(waka);
          count++;
          continue;
        } else {
          moji.push_back(s[si]);
          si--;
        }
      }
      if (moji.size() == n) {
        ans_kouho.push_back(moji);
      }
    } else {
      string moji2 = "";
      si = kouho[i];
      while (moji2.size() < n && si >= 0) {
        if (count < renzoku) {
          moji2.push_back(waka);
          count++;
          continue;
        } else {
          moji2.push_back(s[si]);
          si--;
        }
      }
      si++;
      while (moji2.size() < n && si < n) {
        if (count < renzoku) {
          moji2.push_back(waka);
          count++;
          continue;
        } else {
          moji2.push_back(s[si]);
          si++;
        }
      }
      if (moji2.size() == n) {
        ans_kouho.push_back(moji2);
      }
    }
  }
  sort(ans_kouho.begin(), ans_kouho.end());
  cout << ans_kouho[0] << endl;
  return 0;
}
