#include <bits/stdc++.h>
const long long int M = 1000000007;
using namespace std;
long long power(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = x * res;
    y = y >> 1;
    x = x * x;
  }
  return res;
}
long long power(long long x, long long y, long long mod) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = x * res % mod;
    y = y >> 1;
    x = x * x % mod;
  }
  return res;
}
void nik() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
signed main() {
  nik();
  long long test = 1;
  cin >> test;
  while (test--) {
    long long nn, psum = 0, nsum = 0;
    cin >> nn;
    long long a[nn];
    std::vector<long long> p, n;
    for (long long i = 0; i < nn; i++) {
      cin >> a[i];
      if (a[i] < 0)
        n.push_back(a[i]), nsum += a[i];
      else
        p.push_back(a[i]), nsum += a[i];
    }
    if (psum == -nsum) {
      cout << "NO\n";
      continue;
    }
    sort(p.rbegin(), p.rend());
    sort(n.begin(), n.end());
    if (psum > -nsum) {
      cout << "YES\n";
      for (long long val : p) cout << val << " ";
      for (long long val : n) cout << val << " ";
    } else {
      cout << "YES\n";
      for (long long val : n) cout << val << " ";
      for (long long val : p) cout << val << " ";
    }
    cout << "\n";
  }
  return 0;
}
