#include <bits/stdc++.h>
using namespace std;
string test[345678];
signed main() {
  long long n, k, a = 1;
  string s;
  char mi = 'z';
  cin >> n >> k >> s;
  for (long long h = 0; h < n; h++) {
    mi = min(mi, s[h]);
  }
  if (s[n - 1] == mi) {
    a = 2;
  }
  for (long long h = 2; h <= min(k, (long long)15); h++) {
    a *= 2;
    if (a >= n) {
      for (long long i = 0; i < n; i++) {
        cout << mi;
      }
      cout << endl;
      cin >> n;
      return 0;
    }
  }
  string t = s;
  reverse(s.begin(), s.end());
  t += s;
  for (long long h = 0; h < k; h++) {
    if (h == k - 1) {
    } else {
    }
  }
  cin >> n;
  return 0;
}
