#include <bits/stdc++.h>
#define ll long long int

using namespace std;

int main()
{
   ll t;
   cin>>t;
   while(t--)
   {
       ll n,m,i,j;
       string a,b,c;
       cin>>n>>a;
       vector<int> v;
       for(i=0;i<n;i++)
       {
           if(a[i]=='r')
           b+='r';
           else c+=a[i];
    
       }
    cout<<c<<b<<"\n";   
       
   }
}