#include <bits/stdc++.h>

using namespace std;
 
#define fastio ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define t_times int t; cin >> t; while(t--)
#define fr(i, st, n) for(int i = (int )st; i < (int )n; i++)
#define rfr(i, en, st) for(int i = (int )en; i >= (int )st; i--)
#define all(c) (c).begin(), (c).end()
#define fi first
#define se second
#define pb push_back
#define sz(a) (int)((a).size())
 
typedef long long int LL;
typedef pair< int, int> ii;
typedef vector< int> vi;
typedef vector< ii> vii;
typedef vector< vi> vvi;

template<typename T,typename U>
ostream& operator<<(ostream& out,const pair<T,U>& p){
	out<<"{" <<p.fi<<","<<p.se<<"}";
	return out;
}
template<typename T>
ostream& operator<<(ostream& out,const std::vector<T>& v){
	for(auto& x:v)out<<x<<" ";
	return out;
}

const int mod = 1e9 + 7;
const LL INF = 9e18 + 2e17;
const int inf = 2e9;
const double eps = 1e-10;


void solve() {
	int n; cin >> n;
	map<int,int>cnt;
	fr(i,0,n){
		int x;cin>>x;
		cnt[x]++;
	}
	for(auto& i : cnt){
		cout<<i.fi<<" ";
		i.se--;
	}
	for(auto& i:cnt){
		if(i.se>0){
			fr(j,0,i.se)cout<<i.fi<<" ";
		}
	}
	cout<<endl;
	
}

int main(int argc, char const *argv[])
{
	fastio;
	
	t_times{
	solve();
	}


	return 0;
}
