#include <bits/stdc++.h> 
// #include <ext/pb_ds/assoc_container.hpp> // Common file
// #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
// using namespace __gnu_pbds;
using namespace std;
// typedef tree<
// int,
// null_type,
// less<int>,
// rb_tree_tag,
// tree_order_statistics_node_update>
// ordered_set;
typedef long long ll; 
int main()
{
   
   ll t;cin>>t;
   while(t--){
       ll n;cin>>n;
       vector<ll>a(n); 
       map<int,int>m;
       for(int i=0;i<n;i++)
       {
           cin>>a[i]; 
           m[a[i]]++;
       } 
      for(auto p:m)
       {
           cout<<p.first<<" "; 
           m[p.first]--;
       }
       for(auto p:m)
       {
           int times=p.second;
           while(times>0)
           {
               cout<<p.first<<" ";
               times--;
           }
       }
       cout<<endl;
   }
   return 0;
}