#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll>vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef list<int> li;
typedef set<int> sti;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef unordered_map<int, int> umii;
typedef unordered_map<ll, ll> umll;
typedef unordered_set<ll> us;
typedef priority_queue<ll> pq;
typedef deque<ll> dq;
#define nl "\n"
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define Yes cout<<"YES\n";
#define No cout<<"NO\n";
#define yes cout<<"Yes\n";
#define no cout<<"No\n";
#define F first
#define sc second
#define all(v) v.begin(), v.end()
#define sortv(v) sort(v.begin(), v.end());
#define rsort(v) sort(v.rbegin(), v.rend());
#define revv(v) reverse(v.begin(), v.end());
const int N=1e6+9;
const int mod1=1e9+7, mod2=1e9+9;
const int base1=29, base2=67;
const long long int inf=1e18;
#define saiful_islam_bk
void solve(){
ll n, m; cin>>n>>m; string s; cin>>s;
map<char, vector<ll>>mp;
for(ll i=0;i<n;i++)
{
mp[s[i]].pb(i);
}
for(ll i=0;i<n;i++)
{
if(m==0) break;
for(char j='a';j<s[i];j++)
{
if(mp[j].size()){
swap(s[i], s[mp[j].back()]);
mp[j].pop_back();
m--;
}
}
}
cout<<s<<nl;
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
saiful_islam_bk
ll test=1;
cin>>test;
for(ll ii=1; ii<=test; ii++){
//cout<<"Case "<<ii<<": ";
solve();
}
}