#include <bits/stdc++.h>
using namespace std;
string shorten(string s)
{
for(int i = 0; i < s.size() - 1; i++) {
if(s[i] < s[i + 1]) {
return s.substr(0, i) + s.substr(i + 1);
}
}
return s.substr(0, s.size() - 1);
}
string solve(string s, int n, int k)
{
if(k == n) {
return "0";
}
if(k == 0) {
return s;
}
while(k--) {
s = shorten(s);
}
if(s[0] == '0') {
return "0";
}
return s;
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input1.txt", "r", stdin);
freopen("myout.txt", "w", stdout);
#endif
int tc, n, k;
string s;
cin >> tc;
while(tc--) {
cin >> n >> k >> s;
cout << solve(s, n, k) << endl;
}
return 0;
}