/* Author : Md Shumail
   |---Wanna Be CM---|     */
#include<bits/stdc++.h>
using namespace std;
#define FAST      ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define UMAX      1e5+9
#define F         first
#define S         second
#define debug(v)  for(auto &x:v)clog<<x<<" ";clog<<"\n";
#define print(v)  for(auto &x:v)cout<<x<<" ";cout<<"\n";
#define read(v)   for(auto &x:v)cin>>x;
#define deb(x)    clog<<#x<<" is "<<x<<'\n';
#define all(v)    v.begin(),v.end()
#define pb        push_back
#define MOD       (ll)998244353
#define pii		  pair<int,int>
using ll=long long;
const int MAX=1e5+7;
ll pow(ll a,ll b){if(b==0)return 1; ll res=pow(a,b/2);if(b&1)return (res*res*a)%MOD;else return (res*res)%MOD;}
ll modInv(ll a,ll b=MOD){
  return pow(a,b-2);
}

void solve(){
	int n;cin>>n;
	string s;cin>>s;
	vector<char> ans;
	int nb=0;
	for(int i=0;i<n;i++){
		if(s[i]=='b')nb++;
	}
	if(nb==0){
		cout<<s<<"\n";return;
	}
	for(int i=0;i<nb;i++){
		ans.pb('b');
	}
	for(int i=0;i<n;i++){
		if(s[i]=='b')continue;
		ans.pb(s[i]);
	}
	for(int i=0;i<n;i++){
		cout<<ans[i];
	}cout<<"\n";
}

int main() {
FAST
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int t = 1;
cin>>t;
while (t--) solve();
cerr<<"Time : "<<1000*((double)clock())/(double)CLOCKS_PER_SEC<<"ms\n";
return 0;
}