#include <bits/stdc++.h>
using namespace std;
#define SC scanf
#define PF printf
#define ull unsigned long long
#define ld long double
#define F first
#define S second
#define pb push_back
#define sort_a(a) sort(a.begin(),a.end());
#define sort_d(a) sort(a.rbegin(),a.rend());
#define READ(f) freopen(f, "r", stdin)
#define WRITE(f) freopen(f, "w", stdout)
#define rev(s) reverse(s.begin(),s.end())
#define P(ok) cout << (ok ? "YES\n": "NO\n")
#define __Heart__ ios_base :: sync_with_stdio(false); cin.tie(NULL);
#define ll long long
typedef pair< ll , ll> PII;
char indexToChar(int index) {
return 'a' + index;
}
void solve()
{
int n , m , freq[26] ; cin >> n >> m ;
for(int i = 0 ; i < 26 ; i++) freq[i] = 0 ;
string s ; cin >> s ;
map < int , set < int > > mp ;
set < int > st ;
for(int i = 0 ; i < n ; i++){
int ch = s[i] - 'a' ;
freq[ch]++ ;
mp[ch].insert(-i) ;
st.insert(ch) ;
}
for(auto it : st){
if(!m) break ;
// cout << "before swapping " << indexToChar(it) << " --> " << s << endl ;
vector < pair <int , int > > v ;
int i = 0 ;
while(freq[it] && i < n && m){
int ch = s[i]- 'a' ;
if(it >= ch) i++ ;
else{
freq[it]-- , m-- ;
v.pb({ch , i}) ;
i++ ;
}
}
sort_d(v) ;
// for(auto it : v) cout << it.F ; cout << endl ;
int j = 0 ;
for(auto kt : mp[it]){
if(j == v.size()) break ;
//cout << " swaping.... " << indexToChar(it) << " " << " pos " << kt << " " << v[j].S << endl ;
if(-kt > v[j].S){
swap(s[-kt] , s[v[j++].S]) ;
mp[v[j - 1].F].erase(v[j - 1].S) ;
mp[v[j - 1].F].insert(kt) ;
}
}
// cout << "after swapping " << indexToChar(it) << "--> " << s << endl ;
}
cout << s << "\n" ;
}
int main()
{
__Heart__
int t ; cin >> t ; while(t--) solve() ;
}