#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define fi first
#define se second
#define mk make_pair
int main() 
{    ll t;
     cin>>t;
     while(t--)
     {
          ll n;
          cin>>n;
          
          string s;
          cin>>s;
          
          ll count=0;
          for(ll i=0;i<n;i++)
          {
               if(s[i]=='t')
               count++;
               else
               cout<<s[i];
          }
          for(ll i=0;i<count;i++)
          cout<<"t";
          cout<<"\n";
     }
	// code ends here
	return 0;
}
