#include <bits/stdc++.h>
using namespace std;
string s, t, ans;
vector<int> where[26];
vector<bool> solve(int x)
{
vector<bool> used(s.size(), false);
vector<int> cnt(26);
for (int i = 0; i < x; i++)
cnt[t[i] - 'a']++;
int cn = 0;
for (int i = 0; i < x; i++)
{
if (s[i] != t[i])
used[i] = true;
if (cnt[s[i] - 'a'])
cnt[s[i] - 'a']--;
else
cn++;
}
for (int c = 0; c < 26; c++)
{
int j = (int)where[c].size() - 1;
while (cn && j >= 0 && where[c][j] >= x)
{
used[where[c][j]] = true;
cn--;
j--;
}
}
return used;
}
void updateAns(vector<bool> used, string values)
{
string cur = s;
sort(values.begin(), values.end());
int j = 0;
for (int i = 0; i < used.size(); i++)
{
if (used[i])
cur[i] = values[j++];
}
ans = min(ans, cur);
}
int main()
{
int n, k;
cin >> n >> k >> s;
ans = t = s;
sort(t.begin(), t.end());
for (int i = 0; i < n; i++)
where[s[i] - 'a'].push_back(i);
int left = 0, right = n + 1;
while (left + 1 < right)
{
int mid = (left + right) / 2;
auto used = solve(mid);
if (count(used.begin(), used.end(), true) > k)
right = mid;
else
left = mid;
}
auto used = solve(left);
string values;
for (int i = 0; i < n; i++)
{
if (used[i])
values += s[i];
}
updateAns(used, values);
if (count(used.begin(), used.end(), true) < k)
{
sort(values.begin(), values.end());
int pos = 0, p1 = -1, p2 = -1;
for (int i = 0; i < n; i++)
{
if (used[i])
{
pos++;
continue;
}
if (pos < values.size() && s[i] > values[pos] && p1 == -1)
p1 = i;
if (pos > 0 && s[i] < values[pos - 1] && (p2 == -1 || s[i] <= s[p2]))
p2 = i;
}
for (int p : {p1, p2})
{
if (p != -1)
{
used[p] = true;
updateAns(used, values + s[p]);
used[p] = false;
}
}
}
cout << ans << "\n";
return 0;
}