#include <bits/stdc++.h> 
using namespace std; 
#define int long long int

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);  
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        string s;
        cin>>s;
        string ans;
        int count=0;
        for(int i=0;i<n;i++)
        {
            if(s[i]=='t'){count++;}
            else{ans+=s[i];}
        }
        for(int i=0;i<count;i++){ans+='t';}
        cout<<ans<<endl;


    }

}

