#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
const int maxn=1e6+10;
#define mod 1000000007
int main(){
	fast;
	ll n,t; cin>>t;
	while(t--){
		cin>>n;
		multiset<int> st;
		for(auto i=0;i<n;++i){
			ll x; cin>>x;
			st.insert(x);
		}		
		vector<int> b;	
		for(auto i=0;;++i){
			if(st.find(i)!=st.end()){
				b.push_back(i);
				st.erase(st.find(i));
			}else{
				break;
			}
		}
		for(auto i:st){
			b.push_back(i);
		}
		for(auto i:b)cout<<i<<' ';
		cout<<'\n';
	}	
	return 0;
}
// combnatorics(pigeonhole principle, stars and bars (n+k-1)C(k-1))
// comparator in inbuilt sorting 
// lcs
// period of a string(prefix-function) with KMP
// prime func
// subset production
// factorization
// modpow
// modinv ( a^(p-2)=a^(-1) (mod p) )
// sieve
// ncr
// euler totien func (co prime divisiors upto n)
// matrix exponentation(fast fibonacci)
// dsu
// Trees
// Graphs(dfs,bfs,shortes path etc.)
// DP-Recursion