#include<set>
#include<unordered_set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<string>
#include<cstring>
#include<iostream>
#include<algorithm>
#define fi first
#define se second
#define debug printf(" I am here\n");
 
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int INF=0x3f3f3f3f;

int main()
{
	int t; 
	cin >> t;
	while(t --)
	{
		int n;
		string s;
		cin >> n >> s;
		string ans, temp;
		for(int i = 0 ; i < s.size() ; i ++)
			if(s[i] == 'b') temp += s[i];
			else ans += s[i];
		ans = temp + ans;
		cout << ans << endl;
	}
}