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

#define ll long long
#define fi first
#define se second

const int MAX = 2 * 1e5 + 10;
const int MOD = 1e9 + 7;
ll t;
ll n, m, k;
ll a, b, x, y, x2, y2;
ll bio[MAX];
ll arr[MAX];
vector <ll> v;
string s;

int main() {
    cin >> t;

    while (t--) {
        cin >> n;
        cin >> s;

        b = 0;
        for (int i = 0; i < n; i++) {
            if (s[i] == 'b') b++;
        }

        for (int i = 0; i < b; i++) {
            cout << 'b';
        }
        for (int i = 0; i < n; i++) {
            if (s[i] == 'b') continue;
            cout << s[i];
        }

        cout << "\n";
    }

    return 0;
}
