#include <bits/stdc++.h>
using namespace std;
#define ll long long
bool cmp(pair<int,int> p1, pair<int,int> p2){
return (p1.second < p2.second);
}
void solve()
{
int n, k; cin >> n >> k;
string s; cin >> s;
if (n == k){
cout << 0 << '\n';
return;
}
vector<pair<int,int>> dq;
for(int i = 0; i < n; i++){
dq.push_back({s[i] - '0', i});
}
sort(dq.begin(), dq.end());
for(int i = n - 1; i >= 0; i--){
auto mx = dq[i];
// cout << mx.first << ' ' << mx.second << '\n';
for(auto &x : dq){
if ( (x.second != n+1) and (x.second < mx.second) and (x.first < mx.first)){
x.second = n+1;
k--;
if ( !k ) break;
}
}
if ( !k ) break;
}
//cout << '\n';
sort( dq.begin(), dq.end(), cmp );
int cnt = n-k;
for(auto x : dq){
if ( x.second == n + 1) continue;
cout << x.first ;
cnt--;
if ( cnt == 0 ) break;
}
cout << '\n';
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int t = 1, tc = 0;
cin >> t;
while(t--){
//cout << "Case " << ++tc << ": ";
solve();
}
}