// Problem: A. Meximization   // Contest: Codeforces - Codeforces Round #708 (Div. 2)   // URL: https://codeforces.com/contest/1497/problem/A   // Memory Limit: 256 MB   // Time Limit: 1000 ms   //    // Powered by CP Editor (https://cpeditor.org)      #include <bits/stdc++.h>   using INT=int;   //#define int long long   #define pb push_back   #define eb emplace_back   #define all(a) (a).begin(),(a).end()   using namespace std;   auto &_=std::ignore;   using ll=long long;   using vi=vector<int>;   using vll=vector<ll>;   using vvi=vector<vector<int>>;   using vvll=vector<vector<ll>>;   using pii=pair<int,int>;   using pll=pair<ll,ll>;   constexpr struct{    template<class T>    constexpr operator T()const {return numeric_limits<T>::max();}   } INF;   constexpr struct{    template<class T>    constexpr operator T()const {return numeric_limits<T>::min();}   } MINF;   template<class T>   auto _format(ostream &os,const char *c,const T& cv)->decltype(os<<cv,c+1){    os << cv;    while (*c!= } ) c++;    return c+1;   }   template<size_t i,class T>   auto _format(ostream &os,const char *c,const T& cv)->decltype(   typename enable_if<i==tuple_size<T>::value>::type(1),c+1){return c;}   template<size_t i=0,class T>   auto _format(ostream &os,const char *c,const T& cv)->decltype(   typename enable_if<i!=tuple_size<T>::value>::type(1),c+1){    while (*c!= { ) os << *c++;    c=_format(os,c,get<i>(cv));    return _format<i+1>(os,c,cv);   }   template<class T>   auto _format(ostream &os,const char *c,const T& cv)->decltype(begin(cv),c+1){    const char *ct=c+1;    size_t ic=0;    for (auto &i:cv){     const char *cc=c+1;     while (*cc!= { ){      if (*cc== i ) os << ic,cc++;      else os << *cc++;     }     cc=_format(os,cc,i);     while (*cc!= } ) os << *cc++;     ct=cc;     ic++;    }    return ct+1;   }   string format(const char *c){return string(c);}   template<class T,class ...Args>   string format(const char *c,const T &a,Args&& ...rest){    ostringstream os;    while (*c!= { &&*c!=  0 ) os<< *c++;    if (*c== { ) c=_format(os,c,a);    return os.str()+format(c,forward<Args>(rest)...);   }   template<class ...Args>   ostream& print(Args&& ...rest){return cout<<format(forward<Args>(rest)...);}   #ifdef LOCAL   #define debug(...) cerr<<format(__VA_ARGS__)   #else   #define debug(...) cerr   #endif   template<class T>   void _read(istream& is,T &a){is>>a;}   void _read(istream& is,ll &a){       a=0;bool f=false;char c;       while (!isdigit(c=is.get())&&is.good()) f=c== - ;       if (!is.good()) return ;       do a=(a<<3)+(a<<1)+c- 0 ; while (isdigit(c=is.get()));       if (f) a=-a;   }      void read(){}   template<class T,class ...Args>   void read(T& a,Args& ...args){_read(cin,a);read(args...);}   template<class T>   void reada(vector<T>& v,size_t n){    v.reserve(n);    for (size_t i=0;i<n;i++){     T a;cin>>a;     v.emplace_back(move(a));    }   }   template<class T1,class T2>   bool cmin(T1 &a,const T2 b){return a>b?a=b,1:0;}   template<class T1,class T2>   bool cmax(T1 &a,const T2 b){return a<b?a=b,1:0;}   template<class T1,class T2,class ...T3>   bool cmin(T1 &a,const T2 b,const T3 ...rest){return cmin(a,b)|cmin(a,rest...);}   template<class T1,class T2,class ...T3>   bool cmax(T1 &a,const T2 b,const T3 ...rest){return cmax(a,b)|cmax(a,rest...);}   bool MULTIDATA=true;   struct solution{    int n;map<int,int> m;    void scan(){     read(n);     vi v;     reada(v,n);     for (auto i:v) m[i]++;    }        int solve(){     for (auto mi:m)      if (mi.second){       cout << mi.first <<    ;       m[mi.first]--;      }     for (auto mi:m)      for (int k=0;k<mi.second;k++)       cout << mi.first <<    ;     cout << endl;     return 0;    }    };          INT main(){    cin.tie(0);    ios::sync_with_stdio(false);    int T=1;    if (MULTIDATA) read(T);    while (T--){     auto a=unique_ptr<solution>(new solution());     a->scan();     a->solve();     if (!cin.good()) break;    }    return 0;   }