#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define getMat(x, n, m, val) vector<vector<ll>> x(n, vector<ll> (m, val))
#define setp fixed<<setprecision
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
ll M=1000000000+7;
 
ll power(ll x,ll n)
{
    ll result=1;
    while(n>0)
    {
        if(n % 2 ==1)
            result=(result * x)%M;
        x=(x*x)%M;
        n=n/2;
    }
    return result;
}

int main(){
    ll tt=1;
    cin>>tt;
    while(tt--){
        ll n;
        cin>>n;
        ll a[n];
        map<ll,ll>mp;
        for(ll i=0;i<n;i++){
            cin>>a[i];
            mp[a[i]]++;
        }
        for(auto& it:mp){
            cout<<it.first<<" ";
            it.second--;
        }
        for(auto it:mp){
            for(ll i=0;i<it.second;i++)cout<<it.first<<" ";
        }
        cout<<endl;
    }
}