#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;
string temp=s;
sort(all(temp));
unordered_map<char,int>mp;
for(lli i=k;i<n;i++){
mp[temp[i]]++;
}
string ans="";
for(lli i=0;i<n;i++){
if(mp.find(s[i])!=mp.end()){
ans+=s[i];
}
}
cout<<(ans.size()==0?"0":ans)<<nline;
}
}
int main(){
fastio();
solve();
return 0;
}