#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define ld long double
#define ull unsigned long long
#define lcm(a,b) ((a*b)/__gcd(a,b))
const int MOD = 1000000007;
void solve(){
int n, k;
cin >> n >> k;
string s;
cin >> s;
if (n == k){
cout << 0 << endl;
return;
}
for (int i = 0; i < n-1; i++){
if(!k) break;
if (s[i] < s[i + 1]){
s.erase(i, 1);
k--;
i = 0;
}
}
while(k--) s.pop_back();
cout << s << endl;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
while(t--){
solve();
}
}