#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
const long long int MX = 2e5 + 5;
const long long INF = 1e18;
const long double PI = 4 * atan((long double)1);
const long long int xd[4] = {0, 1, 0, -1}, yd[4] = {1, 0, -1, 0};
namespace io {
void setIn(string s) { freopen(s.c_str(), "r", stdin); }
void setOut(string s) { freopen(s.c_str(), "w", stdout); }
void setIO(string s = "") {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  if ((long long int)s.size()) {
    setIn(s + ".in"), setOut(s + ".out");
  }
}
}  // namespace io
using namespace io;
signed main() {
  setIO("");
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int a[n];
    for (long long int& i : a) cin >> i;
    long long int s = 0;
    for (long long int i : a) s += i;
    if (s == 0) {
      cout << "NO\n";
      continue;
    } else {
      cout << "YES\n";
      sort(a, a + n);
      vector<long long int> pos, neg;
      long long int s1 = 0, s2 = 0;
      for (long long int i = 0; i < n; i++) {
        if (a[i] >= 0)
          pos.push_back(a[i]);
        else
          neg.push_back(a[i]);
      }
      for (long long int i : pos) s1 += i;
      for (long long int i : neg) s2 -= i;
      sort(neg.begin(), neg.end(), greater<long long int>());
      sort(pos.begin(), pos.end(), greater<long long int>());
      if (s1 > s2) {
        for (long long int i : pos) cout << i << " ";
        for (long long int i : neg) cout << i << " ";
      } else {
        for (long long int i : neg) cout << i << " ";
        for (long long int i : pos) cout << i << " ";
      }
      cout << "\n";
    }
  }
  return 0;
}
