#include<bits/stdc++.h>

#define   ll      long long int
#define   ld      long double
#define   vi      vector<int>
#define   vli     vector<long long>
#define   pb      push_back
#define   mp      make_pair
#define   vpi     vector<pair<int,int> >
#define   pi      pair<int, int>
#define   xx      first
#define   yy      second
#define   mod     1000000007LL
#define   maxn    1000005

using namespace std;
const int N = 1e5+7;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        set<int> s;
        vector<int> ans;
        int cnt[101]={};
        for(int i=0;i<n;i++){
            int a;
            cin>>a;
            cnt[a]++;
            s.insert(a);
            if(cnt[a]>1)
                ans.pb(a);
        }
        for(auto c:s)
            cout<<c<<" ";

        sort(ans.begin(),ans.end());

        for(auto i:ans)
            cout<<i<<" ";

        cout<<endl;
    }
}

