/*
* Author: Md. Mahfuzur Rahman
* Purpose: Competitive Programming
*/
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define pb push_back
#define endl '\n'
#define nl cout << endl
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define srt(v) sort(v.begin(),v.end())
#define pii pair<int, int>
#define pll pair<long,long>
#define FAST_IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define minheap priority_queue<long long, vector<long long>, greater<long long>>
#define maxheap priority_queue<long long, vector<long long>>
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; // find_by_order, order_of_key
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const double EPS = 1e-9;
const int MAX = 1e6;
#define debug(x) cout<<#x<<" = ";deb(x);
template <typename T>
void deb(T x) { cout <<"[ "<< x << " ]\n"; }
template <typename T, typename U>
void deb(pair<T, U> p) { cout << "(" << p.first << ", " << p.second << ")\n"; }
template <typename T>
void deb(vector<T> v){cout<<"[ ";for (T val : v) cout << val << " ";cout<<"]"<<endl;}
template <typename T>
void deb(vector<vector<T>> v){for (auto row : v)deb(row);}
template <typename T, typename U>
void deb(vector<pair<T, U>> vec){for ( auto p : vec){deb(p);}cout << endl;}
template <typename T, typename U>
void deb(map<T,U>mp){for(auto x:mp)cout<<"\n( "<<x.first<<" "<<x.second<<" )";cout<<endl;}
template<typename T>
void deb(set<T>set){cout<<"[ ";for(auto x:set)cout<<x<<" ";cout<<"]\n";}
template <typename... T>
void read(T&... args){((cin>>args), ...);}
template <typename... T>
void write(T... args){((cout<<args<<" "), ...);}
bitset<MAX> is_prime;
vector<int> primes;
void sieve()
{
is_prime.set();
is_prime[0] = is_prime[1] = 0;
for (int i = 2; i < MAX; ++i)
{
if (is_prime[i])
{
primes.pb(i);
for (int j = i * i; j < MAX; j += i)
{
is_prime[j] = 0;
}
}
}
}
ll mod_add(ll a, ll b, ll m = MOD) { return (a % m + b % m) % m; }
ll mod_sub(ll a, ll b, ll m = MOD) { return ((a % m - b % m) + m) % m; }
ll mod_mul(ll a, ll b, ll m = MOD) { return (a % m * b % m) % m; }
ll mod_pow(ll a, ll b, ll m = MOD)
{
ll res = 1;
while (b > 0)
{
if (b & 1)
res = mod_mul(res, a, m);
a = mod_mul(a, a, m);
b >>= 1;
}
return res;
}
// File I/O (uncomment if needed)
// ifstream infile("input.txt");
// ofstream outfile("output.txt");
void solve(int tc)
{
ll n,k;cin>>n>>k;
string s;cin>>s;
multiset<pair<char,ll>>mt;
ll ind=0;
for(auto x:s)
{
mt.insert({x,ind++});
}
for(ll i=0;i<n;i++)
{
if(s[i]>(*mt.begin()).ff)
{
swap(s[i],s[(*mt.begin()).ss]);
mt.erase(mt.begin());
k--;
if(k==0)break;
}
else
{
mt.erase(mt.begin());
}
}
cout<<s<<endl;
}
int main()
{
FAST_IO;
int t = 1;
int tc=1;
cin >> t;
while (t--)
{
solve(tc++);
}
// For file I/O
// infile.close();
// outfile.close();
return 0;
}