#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int MOD = 1e9 + 7;
void solve(){
int n;
cin >> n;
vector<int> a(n);
map<int, int> m;
bool pos = true;
for(int i = 0; i < n; i++){
cin >> a[i];
m[a[i]]++;
if(m[a[i]] > (n + 1) / 2){
pos = false;
}
}
if(n <= 2){
for(auto x: a)cout << x << " ";
cout << "\n";
return;
}
if(!pos){
cout << -1 << "\n";
return;
}
sort(a.begin(), a.end());
for(auto x: m){
if(x.second == (n + 1) / 2){
int p = 0;
int idx = 0;
cout << "YES\n";
while(idx < n){
cout << x.first << " ";
idx++;
if(idx == n)break;
while(a[p] == x.first)p++;
cout << a[p++] << " ";
idx++;
}
cout << "\n";
return;
}
}
vector<int> c, d;
int sz = (n + 1) / 2;
for(int i = 0; i < n; i++){
if(c.size() < sz)c.push_back(a[i]);
else d.push_back(a[i]);
}
int x = 0, y = 0;
while(x < c.size()){
cout << c[x++] << " ";
if((n % 2) && x == c.size())break;
cout << d[y++] << " ";
}
cout << "\n";
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t = 1;
cin >> t;
for(int i = 1; i <= t; i++){
solve();
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgbGwgbG9uZyBsb25nCgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3QgaW50IE1PRCA9IDFlOSArIDc7Cgp2b2lkIHNvbHZlKCl7CiAgICBpbnQgbjsKICAgIGNpbiA+PiBuOwogICAgCiAgICB2ZWN0b3I8aW50PiBhKG4pOwogICAgCiAgICBtYXA8aW50LCBpbnQ+IG07CiAgICBib29sIHBvcyA9IHRydWU7CiAgICBmb3IoaW50IGkgPSAwOyBpIDwgbjsgaSsrKXsKICAgICAgICBjaW4gPj4gYVtpXTsKICAgICAgICBtW2FbaV1dKys7CiAgICAgICAgaWYobVthW2ldXSA+IChuICsgMSkgLyAyKXsKICAgICAgICAgICAgcG9zID0gZmFsc2U7CiAgICAgICAgfQogICAgfQogICAgaWYobiA8PSAyKXsKICAgICAgICBmb3IoYXV0byB4OiBhKWNvdXQgPDwgeCA8PCAiICI7CiAgICAgICAgY291dCA8PCAiXG4iOwogICAgICAgIHJldHVybjsKICAgIH0KICAgIGlmKCFwb3MpewogICAgICAgIGNvdXQgPDwgLTEgPDwgIlxuIjsKICAgICAgICByZXR1cm47CiAgICB9CiAgICBzb3J0KGEuYmVnaW4oKSwgYS5lbmQoKSk7CiAgICBmb3IoYXV0byB4OiBtKXsKICAgICAgICBpZih4LnNlY29uZCA9PSAobiArIDEpIC8gMil7CiAgICAgICAgICAgIGludCBwID0gMDsKICAgICAgICAgICAgaW50IGlkeCA9IDA7CiAgICAgICAgICAgIGNvdXQgPDwgIllFU1xuIjsKICAgICAgICAgICAgd2hpbGUoaWR4IDwgbil7CiAgICAgICAgICAgICAgICBjb3V0IDw8IHguZmlyc3QgPDwgIiAiOwogICAgICAgICAgICAgICAgaWR4Kys7CiAgICAgICAgICAgICAgICBpZihpZHggPT0gbilicmVhazsKICAgICAgICAgICAgICAgIHdoaWxlKGFbcF0gPT0geC5maXJzdClwKys7CiAgICAgICAgICAgICAgICBjb3V0IDw8IGFbcCsrXSA8PCAiICI7CiAgICAgICAgICAgICAgICBpZHgrKzsKICAgICAgICAgICAgfQogICAgICAgICAgICBjb3V0IDw8ICJcbiI7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICB9CiAgICB9CiAgICAKICAgCiAgIAogICB2ZWN0b3I8aW50PiBjLCBkOwogICBpbnQgc3ogPSAobiArIDEpIC8gMjsKICAgZm9yKGludCBpID0gMDsgaSA8IG47IGkrKyl7CiAgICAgICBpZihjLnNpemUoKSA8IHN6KWMucHVzaF9iYWNrKGFbaV0pOwogICAgICAgZWxzZSBkLnB1c2hfYmFjayhhW2ldKTsKICAgfQogICAKICAgaW50IHggPSAwLCB5ID0gMDsKICAgCiAgIHdoaWxlKHggPCBjLnNpemUoKSl7CiAgICAgICBjb3V0I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EwMSAxMDUgMTAyIDEwOCAxMDcgMTA5IDk5IDEwNyAxMDMgMTEwIDEwMyAxMDMgMTAzIDEwNiAxMDMgMTAzIDEwMiAxMDMgMTA3IDEwMyAxMDMgMTAzIDEwNCAxMDcgMTAwIDEwMyAxMDAgMTAzIDEwMyAxMDcgMTAzIDEwMSAxMDMgMTAyIDEwMyAxMDEgMTAzIDEwMyAxMDMgMTAzIDEwOSA5OSAxMDMgMTAwIDEwNCAxMDEgMTEwIDEwMyAxMDMgMTAzIDEwNyA5OSAxMDUgMTAzIDEwMyAxMDEgMTAzIDEwMyAxMDMgMTAzIDEwMCAxMDggMTA1IDEwNCAxMDMgMTAzIDk5IDEwMyAxMDggMTA1IDEwOSAxMDMK
1
582
99 104 108 101 108 100 104 103 103 103 103 99 103 103 102 108 99 103 108 104 105 103 106 103 103 110 102 105 103 103 100 106 103 103 106 103 106 103 103 103 103 103 110 103 103 103 99 102 103 103 103 103 107 103 103 100 103 103 104 110 100 103 103 102 102 103 103 108 102 110 103 103 103 103 105 107 101 103 103 103 102 103 103 101 104 107 103 103 99 107 103 103 102 110 103 103 103 103 103 103 106 103 107 105 103 100 103 103 103 108 100 103 103 103 103 103 105 107 109 103 103 103 103 103 103 103 99 103 106 103 103 106 99 110 103 108 103 108 103 103 103 103 105 107 107 100 108 103 105 103 105 101 104 107 103 103 103 103 99 99 99 104 106 107 103 107 101 103 102 103 109 103 103 102 106 110 109 103 101 103 103 103 103 103 103 103 109 100 108 101 107 107 109 103 107 103 103 104 109 103 100 103 103 103 103 103 99 103 107 103 102 103 109 103 103 103 103 103 103 103 101 103 103 104 103 103 107 104 103 103 100 103 103 103 103 103 103 103 101 100 103 107 104 103 110 107 102 101 105 103 110 104 102 104 103 109 101 103 99 108 100 106 103 103 107 106 103 109 104 106 103 103 103 102 108 103 103 105 99 100 103 101 105 108 106 108 103 109 106 102 101 108 99 110 103 100 103 105 103 107 103 103 103 103 103 103 107 103 106 99 102 107 101 107 103 109 101 99 103 103 110 106 103 103 105 103 104 103 110 99 104 102 110 102 103 110 103 106 103 103 103 100 102 107 103 103 103 110 107 103 103 103 110 102 102 99 102 103 107 108 103 104 103 103 103 107 103 110 110 110 102 100 109 103 103 103 103 106 103 103 108 99 103 103 107 103 109 103 103 102 103 103 100 103 103 110 100 109 108 110 103 99 103 103 108 103 110 103 103 103 103 109 103 103 103 103 103 104 103 109 105 105 101 103 103 102 103 104 103 103 102 103 102 103 100 103 108 108 103 103 103 107 103 106 103 110 99 103 103 107 100 100 103 107 99 101 103 103 109 103 103 103 103 107 100 103 103 102 103 104 103 103 103 110 103 103 103 103 101 109 103 103 104 107 107 103 106 102 103 102 101 108 103 103 99 103 109 103 103 103 100 103 109 103 108 103 103 107 103 103 101 105 102 108 107 109 99 107 103 110 103 103 103 106 103 103 102 103 107 103 103 103 104 107 100 103 100 103 103 107 103 101 103 102 103 101 103 103 103 103 109 99 103 100 104 101 110 103 103 103 107 99 105 103 103 101 103 103 103 103 100 108 105 104 103 103 99 103 108 105 109 103