#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define bug(a) cout<< #a << " : " << a <<endl;
#define bug2(a, b) cout<< #a << " : " << a << " " << #b << " : " << b << endl;
void solve(int cs){
int n, k;
cin >> n >> k;
string s;
if(n == 0){
return;
}
cin >> s;
if(k == n){
cout << 0 << '\n';
return;
}
vector<int> idx[10];
for(int i = 0;i < n;i++){
idx[s[i] - '0'].push_back(i);
}
for(int i = 0;i <= 9;i++){
sort(idx[i].rbegin(), idx[i].rend());
}
vector<bool> ok(n, true);
while(k--){
for(int i = 0;i < 10;i++){
if(idx[i].size()){
ok[idx[i].back()] = false;
idx[i].pop_back();
break;
}
}
}
for(int i = 0;i < n;i++){
if(ok[i]) cout << s[i];
}
cout << '\n';
}
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);
cout.tie(0);
int tc = 1;
cin >> tc;
for(int cs = 1; cs <= tc; cs++){
solve(cs);
}
}