#include <bits/stdc++.h>
#include <math.h> 
using namespace std;
#define ll long long
#define int long long
#define endl "\n"
#define sz(x) (int)(x).size()
#define SQRT(x) ((LL)(x) * (x))
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define Max(x,y,z) max(x,max(y,z))
#define Min(x,y,z) min(x,min(y,z))

void solve()
{

        int n;cin>>n;
        string s;
        cin>>s;
        int j = 0;
        for(int i = 0 ; i < n ; i++){
            if(s[i]=='b'){
                swap(s[j],s[i]);
                j++;
            }
        }
        cout<<s<<"\n";

}
int32_t main() 
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt" , "r" , stdin);
    freopen("output.txt","w",stdout);
   #endif
int t;
cin >> t;
while(t--)
{
     solve();
}
}