#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
long double pi = 2 * acos(0.0);
const ll mod = 998244353;

void solve() {
    ll n;
    cin >> n;
    string s;
    cin >> s;
    ll tcnt = 0;
    for(ll i = 0; i < n; i++) {
        if(s[i] != 't') cout << s[i];
        else tcnt++;
    }    
    for(ll i = 0; i < tcnt; i++) cout << 't';
    cout << "\n";
}

int main() {
    ios_base :: sync_with_stdio(false); 
    cin.tie(nullptr);   
    ll t = 1;
    cin >> t;
    while(t--) {
        solve();
    }
    return 0;
}