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

#define db(...) << " [" << #__VA_ARGS__ << ": " << __VA_ARGS__ << "] "

#define ii pair<int, int>
#define double long double
#define int long long

void min_self(int &self, int other) {
    self = min(self, other);
}

void max_self(int &self, int other) {
    self = max(self, other);
}

const int MOD = 1e9 + 7;

void add_self(int &self, int other) {
    self = (self + other) % MOD;
}

int n;
string s;
void solve() {
    cin >> n >> s;
    string res;
    int cnt = 0;
    for (char ch : s) {
        if (ch != 'b') {
            res += ch;
        } else ++cnt;
    }
    cout << string(cnt, 'b') << res << "\n";
}

#undef int
int main()
{
    int t; cin >> t; for (int i = 1; i <= t; ++i)
        solve();
    return 0;
}
