#include<bits/stdc++.h>
#define ll long long int
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define _K 1000000007
#define PI 3.1415926535897932384626
#define F(i,L,R) for (int i = L; i < R; i++)
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define FF(i,L,R) for (int i = L; i > R; i--)
#define FFE(i,L,R) for (int i = L; i >= R; i--)
#define ALL(c) (c).begin(),(c).end()
#define pb push_back
#define um unordered_map

using namespace std;

int main(){
int t;
cin>>t;
while(t--){
	int n;
	cin>>n;
 	map<int,int> m;
 	for(int i=0;i<n;i++)
 	{
 		int x;
 		cin>>x;
 		m[x]++;
	 }
	 int b[n];
	 vector<int> v;
	 for(auto i=m.begin();i!=m.end();i++)
	 {
	 	cout<<i->first<<" ";
	 	while((i->second)-1>0)
	 	{
	 		v.pb(i->first);
	 		i->second=(i->second)-1;
		 }
	 }
	 for(int i=0;i<v.size();i++)
	 {
	 	cout<<v[i]<<" ";
	 }
	cout<<"\n";
	}
}
