#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<vector<ll>> vvl;
typedef vector<ll> vll;
#define F(i,a,n) for(ll i=a;i<n;i++)
#define mod 1000000007
#define mod2 998244353
#define all(x) x.begin(),x.end()
#define INF (1e18)+5

ll square_root(ll n){
	ll l=1,r=1e9+1;
	while(l<=r){
		ll m=(l+r)/2;
		if(m*m<=n&&(m+1)*(m+1)>n)return m;
		else if(m*m<n){
			l=m+1;
		}
		else {
			r=m-1;
		}
	}
	return 0;
}

bool isPrime(ll n){
	if(n==1)
	return false;
	for(ll i=2;i*i<=n;i++){
		if(n%i==0)
		return false;
	}
	return true;
}
ll cube_root(ll n){
	ll l=1,r=1e5+1;
	while(l<=r){
		ll m=(l+r)/2;
		if(m*m*m<=n&&(m+1)*(m+1)*(m+1)>n){
			return m;
		}
		else if(m*m*m<n){
			l=m+1;
		}
		else {
			r=m-1;
		}
	}
	return 0;
}
struct X{
	bool operator()(const ll &p1,const ll &p2){
		return abs(p1)<abs(p2);
	}
};
#define MAXN 105
vll v(MAXN,0);
ll n;
void solve(){
	cin>>n;
	map<ll,ll>m;
	F(i,0,n){cin>>v[i];
		m[v[i]]++;
	}
	vector<pll>x;
	for(auto i:m){
		x.push_back({i.first,i.second});
	}
	sort(all(x),greater<pll>());
	deque<ll>dq;
	for(auto i:x){
		dq.push_front(i.first);
		while(--i.second){
			dq.push_back(i.first);
		}
	}
	while(!dq.empty()){
		cout<<dq.front()<<" ";
		dq.pop_front();
	}
	cout<<endl;
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll w=1;
	cin>>w;
	while(w--){
        solve();
	}
	return 0;
}