#include <bits/stdc++.h>

#define debug(x) cout << (#x) << " = " << x << endl;
#define mem(a,b) memset(a,b,sizeof(a))
#define fastio ios_base::sync_with_stdio(false); cin.tie(0);
#define ll long long
#define ld long double
#define pi 3.1415926535897932384626433
#define MOD 1e9 + 7
#define inf 1e8
#define llinf 1e18
#define sys system("pause")

using namespace std;

const int N = 1e5 + 10;

void file_use(){
    fastio
    #ifndef ONLINE_JUDGE
        freopen("in.txt","r",stdin);
        freopen("out.txt","w",stdout);
    #endif
}
string solve(int n, string s){
    string ans = "";
    int count = 0;
    for (int i = 0; i < n; i++){
        if (s[i] == 't') count++;
        else ans += s[i];
    }
    while (count--) ans += 't';
    return ans;
}

int main(){
    file_use();
    int t;
    cin >> t;
    while(t--){
        int n;
        cin >> n;
        string s;
        cin >> s;
        cout << solve(n,s) << '\n';
    }
    return 0;
}
//cout << a[i][j] << " \n"[j == m];
// pair<int, int> p; p = {3,4}
