#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
#define mod 1000000007
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
 int t;
 cin>>t;
 while(t--){
   int n;
   cin>>n;
   string s;
   cin>>s;
   for(int i=0;i<n;i++){
    if(s[i]!='t')
        cout<<s[i];
   }
   for(int i=0;i<n;i++){
    if(s[i]=='t')
        cout<<"t";
   }

 cout<<"\n";
 }
}
