#include <cstdio>
#include <algorithm>
static const int N = (int)1e6;
static const int INF = (int)1e9;
int n, k;
char s[N + 2], t[N + 2];
int cnt[26], p[26];
int ans[26], ans_size;
int cur[26];
bool comp(const int &x, const int &y) {
return cnt[x] < cnt[y];
}
int main() {
freopen("input.txt", "rt", stdin);
freopen("output.txt", "wt", stdout);
scanf("%d%d\n%s", &n, &k, s);
k = std::min(n, k);
for (int i = 0; i < n; i++)
cnt[s[i] - 'a']++;
for (int i = 0; i < 26; i++)
p[i] = i;
std::sort(p, p + 26, comp);
ans_size = INF;
for (int i = 0, sum = 0; i < 26; i++) {
if (sum > k)
break;
for (int j = i; j < 26; j++)
cur[j] = cnt[p[j]];
for (int j = 0; j < i; j++) {
for (int k = 0; k < cnt[p[j]]; k++) {
int p = i;
for (int l = i; l < 26; l++)
if (cur[l] < cur[p])
p = l;
cur[p]++;
}
}
for (int j = sum; j < k; j++) {
int pl = i, ph = i;
for (int k = i; k < 26; k++) {
if (cur[k] < cur[pl])
pl = k;
if (cur[k] > cur[ph])
ph = k;
}
if (cur[pl] < cur[ph])
cur[pl]++, cur[ph]--;
}
int pl = 0, ph = 0;
for (int j = 0; j < 26; j++) {
if (cur[j] > 0 && (cur[pl] == 0 || cur[j] < cur[pl]))
pl = j;
if (cur[j] > 0 && (cur[ph] == 0 || cur[j] > cur[ph]))
ph = j;
}
if (cur[ph] - cur[pl] < ans_size)
{
ans_size = cur[ph] - cur[pl];
for (int j = 0; j < 26; j++)
ans[p[j]] = cur[j];
}
sum += cnt[p[i]], cur[i] = 0;
}
for (int i = 0; i < 26; i++) {
for (int j = 0; j < n && ans[i] > 0; j++)
if (t[j] == 0 && s[j] == i + 'a')
t[j] = i + 'a', ans[i]--;
}
for (int i = 0; i < 26; i++) {
for (int j = 0; j < n && ans[i] > 0; j++)
if (t[j] == 0)
t[j] = i + 'a', ans[i]--;
}
printf("%s", t);
return 0;
}
I2luY2x1ZGUgPGNzdGRpbz4KI2luY2x1ZGUgPGFsZ29yaXRobT4KCnN0YXRpYyBjb25zdCBpbnQgTiA9IChpbnQpMWU2OwpzdGF0aWMgY29uc3QgaW50IElORiA9IChpbnQpMWU5OwoKaW50IG4sIGs7CmNoYXIgc1tOICsgMl0sIHRbTiArIDJdOwppbnQgY250WzI2XSwgcFsyNl07CmludCBhbnNbMjZdLCBhbnNfc2l6ZTsKaW50IGN1clsyNl07Cgpib29sIGNvbXAoY29uc3QgaW50ICZ4LCBjb25zdCBpbnQgJnkpIHsKICAgIHJldHVybiBjbnRbeF0gPCBjbnRbeV07Cn0KCmludCBtYWluKCkgewogICAgZnJlb3BlbigiaW5wdXQudHh0IiwgInJ0Iiwgc3RkaW4pOwogICAgZnJlb3Blbigib3V0cHV0LnR4dCIsICJ3dCIsIHN0ZG91dCk7CgogICAgc2NhbmYoIiVkJWRcbiVzIiwgJm4sICZrLCBzKTsKCiAgICBrID0gc3RkOjptaW4obiwgayk7CgogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspCiAgICAgICAgY250W3NbaV0gLSAnYSddKys7CgogICAgZm9yIChpbnQgaSA9IDA7IGkgPCAyNjsgaSsrKQogICAgICAgIHBbaV0gPSBpOwoKICAgIHN0ZDo6c29ydChwLCBwICsgMjYsIGNvbXApOwoKICAgIGFuc19zaXplID0gSU5GOwoKICAgIGZvciAoaW50IGkgPSAwLCBzdW0gPSAwOyBpIDwgMjY7IGkrKykgewogICAgICAgIGlmIChzdW0gPiBrKQogICAgICAgICAgICBicmVhazsKCiAgICAgICAgZm9yIChpbnQgaiA9IGk7IGogPCAyNjsgaisrKQogICAgICAgICAgICBjdXJbal0gPSBjbnRbcFtqXV07CgogICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgaTsgaisrKSB7CiAgICAgICAgICAgIGZvciAoaW50IGsgPSAwOyBrIDwgY250W3Bbal1dOyBrKyspIHsKICAgICAgICAgICAgICAgIGludCBwID0gaTsKCiAgICAgICAgICAgICAgICBmb3IgKGludCBsID0gaTsgbCA8IDI2OyBsKyspCiAgICAgICAgICAgICAgICAgICAgaWYgKGN1cltsXSA8IGN1cltwXSkKICAgICAgICAgICAgICAgICAgICAgICAgcCA9IGw7CgogICAgICAgICAgICAgICAgY3VyW3BdKys7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIGZvciAoaW50IGogPSBzdW07IGogPCBrOyBqKyspIHsKICAgICAgICAgICAgaW50IHBsID0gaSwgcGggPSBpOwoKICAgICAgICAgICAgZm9yIChpbnQgayA9IGk7IGsgPCAyNjsgaysrKSB7CiAgICAgICAgICAgICAgICBpZiAoY3VyW2tdIDwgY3VyW3BsXSkKICAgICAgICAgICAgICAgICAgICBwbCA9IGs7CiAgICAgICAgICAgICAgICBpZiAoY3VyW2tdID4gY3VyW3BoXSkKICAgICAgICAgICAgICAgICAgICBwaCA9IGs7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGlmIChjdXJbcGxdIDwgY3VyW3BoXSkKICAgICAgICAgICAgICAgIGN1cltwbF0rKywgY3VyW3BoXS0tOwogICAgICAgIH0KCiAgICAgICAgaW50IHBsID0gMCwgcGggPSAwOwoKICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IDI2OyBqKyspIHsKICAgICAgICAgICAgaWYgKGN1cltqXSA+IDAgJiYgKGN1cltwbF0gPT0gMCB8fCBjdXJbal0gPCBjdXJbcGxdKSkKICAgICAgICAgICAgICAgIHBsID0gajsKCiAgICAgICAgICAgIGlmIChjdXJbal0gPiAwICYmIChjdXJbcGhdID09IDAgfHwgY3VyW2pdID4gY3VyW3BoXSkpCiAgICAgICAgICAgICAgICBwaCA9IGo7CiAgICAgICAgfQoKICAgICAgICBpZiAoY3VyW3BoXSAtIGN1cltwbF0gPCBhbnNfc2l6ZSkKICAgICAgICB7CiAgICAgICAgICAgIGFuc19zaXplID0gY3VyW3BoXSAtIGN1cltwbF07CgogICAgICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IDI2OyBqKyspCiAgICAgICAgICAgICAgICBhbnNbcFtqXV0gPSBjdXJbal07CiAgICAgICAgfQoKICAgICAgICBzdW0gKz0gY250W3BbaV1dLCBjdXJbaV0gPSAwOwogICAgfQoKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgMjY7IGkrKykgewogICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgbiAmJiBhbnNbaV0gPiAwOyBqKyspCiAgICAgICAgICAgIGlmICh0W2pdID09IDAgJiYgc1tqXSA9PSBpICsgJ2EnKQogICAgICAgICAgICAgICAgdFtqXSA9IGkgKyAnYScsIGFuc1tpXS0tOwogICAgfQoKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgMjY7IGkrKykgewogICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgbiAmJiBhbnNbaV0gPiAwOyBqKyspCiAgICAgICAgICAgIGlmICh0W2pdID09IDApCiAgICAgICAgICAgICAgICB0W2pdID0gaSArICdhJywgYW5zW2ldLS07CiAgICB9CgogICAgcHJpbnRmKCIlcyIsIHQpOwoKICAgIHJldHVybiAwOwp9Cg==