#include "bits/stdc++.h"
#ifdef PRINTERS
#include "printers.hpp"
using namespace printers;
#define tr(a)        cerr<<#a<<": "<<a<<endl;
#else
#define tr(a)    
#endif
#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define hell        1000000007
#define endl        '\n'
#define rep(i,a,b)    for(int i=a;i<b;i++)
#define delta       idx
#define gamma       temp

using namespace std;

vi delta;
map<int,int>gamma;
int n;
bool recurse(int u){
    if(u==n-2){
        sort(all(idx));
        for(auto j:idx)cout<<j<<" ";
        cout<<endl;
        return 1;
    }
    {
        bool isGood=1;
        idx.pb(temp.rbegin()->F);
        vi erased;
        rep(k,0,u+2){
            auto it=temp.find(abs(idx[k]-idx.back()));
            if(it==temp.end()){
                isGood=0;
                break;
            }
            else{
                erased.pb(it->F);
                it->S--;
                if(it->S==0)temp.erase(it);
            }
        }
        if(isGood and recurse(u+1))return 1;
        idx.pop_back();
        for(auto i:erased)temp[i]++;
    }
    {
        bool isGood=1;
        idx.pb(idx[1]-temp.rbegin()->F);
        vi erased;
        rep(k,0,u+2){
            auto it=temp.find(abs(idx[k]-idx.back()));
            if(it==temp.end()){
                isGood=0;
                break;
            }
            else{
                erased.pb(it->F);
                it->S--;
                if(it->S==0)temp.erase(it);
            }
        }
        if(isGood and recurse(u+1))return 1;
        idx.pop_back();
        for(auto i:erased)temp[i]++;
    }
    return 0;
}
void solve(){
    gamma.clear();
    delta.clear();
    cin>>n;
    rep(i,0,(n*(n-1))/2){
        int alpha;
        cin>>alpha;
        gamma[alpha]++;
    }
    if(n==2){
        cout<<0<<" "<<gamma.begin()->F<<endl;
        return;
    }
    delta.pb(0);
    delta.pb(gamma.rbegin()->F);
    gamma.rbegin()->S--;
    if(gamma.rbegin()->S==0){
        gamma.erase(gamma.rbegin()->F);
    }
    assert(recurse(0));
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    cin>>t;
    while(t--){
        solve();
    }
    return 0;
}