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

int main() {
	// your code goes here
	int t;cin>>t;
	while(t--){
	int n;cin>>n;
	int a[n];map<int,int>m;m.clear();
	for(int i=0;i<n;i++){
		cin>>a[i];m[a[i]]++;
	}
	auto it=m.begin();
	while(it!=m.end()){
		cout<<it->first<<" ";it++;
	}
	it=m.begin();
	while(it!=m.end()){
		while(it->second>1){
			cout<<it->first<<" ";
			it->second--;
			}
			it++;
	}
	cout<<endl;
	}
	return 0;
}