#include <bits/stdc++.h>
using namespace std;
int main() {
    // cout<<"Hello World!
    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.push_back(s[i]);
        }
        while(count--) ans.push_back('t');
        cout<<ans<<endl;
    }
}
