#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define bug(a) cout << #a << " : " << a << endl;
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;
}
stack<int> st;
for(auto c : s){
int x = c - '0';
while ( !st.empty() and (st.top() < x ) and k) {
st.pop();
k--;
}
st.push(x);
}
while( k and !st.empty() ) {
st.pop();
k--;
}
string ans = "";
while( !st.empty() ) {
ans.push_back(st.top() + '0');
st.pop();
}
reverse( ans.begin(), ans.end() );
cout << ans << '\n';
//return ans;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int t = 1, tc = 0;
cin >> t;
while(t--){
//cout << "Case " << ++tc << ": ";
solve();
}
}