#include <bits/stdc++.h>
using namespace std;
void func(long long a[], long long n) {
  long long sum = 0, sn = 0, sp = 0, n0 = 0;
  long long i;
  for (i = 0; i < n; i = i + 1) {
    sum += a[i];
    if (a[i] < 0)
      sn += a[i];
    else if (a[i] > 0)
      sp += a[i];
    else
      n0++;
  }
  if (sum == 0) {
    cout << "NO" << endl;
    return;
  } else {
    cout << "YES" << endl;
    if (abs(sn) > sp) {
      sort(a, a + n);
    } else {
      sort(a, a + n, greater<int>());
    }
    for (i = 0; i < n; i++) {
      if (a[i] != 0) cout << a[i] << " ";
    }
    for (i = 0; i < n0; i = i + 1) cout << "0 ";
    cout << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n, i, j, k;
    cin >> n;
    long long a[n];
    for (i = 0; i < n; i = i + 1) cin >> a[i];
    func(a, n);
  }
}
