#pragma GCC optimize("O3,unroll-loops")
#include<bits/stdc++.h>
using namespace std;
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define nline "\n"
#define pb push_back
#define ppb pop_back
#define set_bits __builtin_popcountll
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long long int lli;
typedef unsigned long long ull;
typedef long double lld;
const int MK=60;
const ll MOD=1000000007;
void solve(){
int t;
cin>>t;
while(t--){
lli n,k;
cin>>n>>k;
string s;
cin>>s;
if(k==n){
cout<<"0"<<nline;
continue;
}
stack<char>st;
for(int i=0;i<n;i++){
while(!st.empty() && st.top()<s[i]&&k>0){
st.pop();
k--;
}
st.push(s[i]);
}
string temp="";
while(k>0 &&!st.empty()){
st.pop();
k--;
}
while(!st.empty()){
temp+=st.top();
st.pop();
}
reverse(all(temp));
cout<<(temp.empty()?"0":temp)<<nline;
}
}
int main(){
fastio();
solve();
return 0;
}