#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define bug(a) cout<< #a << " : " << a <<endl;
#define bug2(a, b) cout<< #a << " : " << a << " " << #b << " : " << b << endl;
string s;
const int N = 105;
string dp[N][N];
string f(int i, int k){
if(k == 0)return "";
if(i == s.size())return "$";
if(dp[i][k] != "$")return dp[i][k];
string tm = s[i] + f(i+1, k);
if(tm.back() == '$')tm = "";
tm = max(tm,f(i+1,k-1));
return dp[i][k] = tm;
}
void solve(int cs){
int n,k; cin >> n >> k;
cin >> s;
if(k == n){
cout << 0 << '\n';
return;
}
if(k == 0){
cout << s << '\n';
return;
}
for(int i = 0; i < N; i++){
for(int j = 0; j < N; j++)dp[i][j] = "$";
}
cout << f(0,k) << '\n';
}
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);
cout.tie(0);
int tc = 1;
cin >> tc;
for(int cs = 1; cs <= tc; cs++){
solve(cs);
}
}