#include <iostream>
#include <cstdio>
#include <cstring>
#include <map>
#include <algorithm>
#include <string>
#include <set>
#include <vector>
using namespace std;
int main ()
{
int k;
string s;
cin >> s;
cin >> k;
for (int i = 1; i < 50000005; ++i)
{
for (int j = 1; j < s.size() && k; ++j)
{
if (s[j] > s[j-1])
{
swap(s[j], s[j-1]);
--k;
j = 0;
}
}
}
cout << s;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0ZGlvPgojaW5jbHVkZSA8Y3N0cmluZz4KI2luY2x1ZGUgPG1hcD4KI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPHNldD4KI2luY2x1ZGUgPHZlY3Rvcj4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG1haW4gKCkKewoJaW50IGs7CglzdHJpbmcgczsKCWNpbiA+PiBzOwoJY2luID4+IGs7Cglmb3IgKGludCBpID0gMTsgaSA8IDUwMDAwMDA1OyArK2kpCgl7CgkJZm9yIChpbnQgaiA9IDE7IGogPCBzLnNpemUoKSAmJiBrOyArK2opCgkJewoJCQlpZiAoc1tqXSA+IHNbai0xXSkKCQkJewoJCQkJc3dhcChzW2pdLCBzW2otMV0pOwoJCQkJLS1rOwoJCQkJaiA9IDA7CgkJCX0KCQl9Cgl9Cgljb3V0IDw8IHM7CglyZXR1cm4gMDsKfQk=