#include <bits/stdc++.h>
using namespace std;
long long powe(long long n, long long m) {
  if (m == 0) return 1;
  long long t = powe(n, m / 2);
  if (m % 2 == 0) return (t * t);
  return (((t * t)) * n);
}
long long mpowe(long long n, long long m, long long MOD) {
  if (m == 0) return 1;
  long long t = mpowe(n, m / 2, MOD);
  t %= MOD;
  if (m % 2 == 0) return (t * t) % MOD;
  return (((t * t) % MOD) * n) % MOD;
}
long long logtwo(long long n) {
  if (n == 1) return 0;
  if (n == 0) return -1;
  return logtwo(n / 2) + 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    for (long long i = 0; i < n; i++) cin >> a[i];
    ;
    sort(a, a + n);
    long long sum = 0, f = 0;
    for (int i = 0; i < n; i++) {
      sum += a[i];
      if (sum == 0) f = 1;
    }
    if (f == 1) {
      f = 0;
      sum = 0;
      sort(a, a + n, greater<long long>());
      for (int i = 0; i < n; i++) {
        sum += a[i];
        if (sum == 0) f = 1;
      }
      if (f == 1)
        cout << "NO" << endl;
      else {
        cout << "YES" << endl;
        for (long long i = 0; i < n; i++) cout << a[i] << " ";
        cout << endl;
      }
    } else {
      cout << "YES" << endl;
      for (long long i = 0; i < n; i++) cout << a[i] << " ";
      cout << endl;
    }
  }
}
