#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, p;
    cin >> n;
    long long int a[n], b[n], l = 0, h = 0, ans = 0;
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] > 0)
        l = l + a[i];
      else
        h = h + a[i];
    }
    sort(a, a + n);
    for (long long int i = 0; i < n; i++) {
      b[i] = a[n - i - 1];
    }
    if (l == h * -1)
      cout << "NO\n";
    else {
      cout << "YES\n";
      if (l > (-1 * h)) {
        for (long long int i = 0; i < n; i++) {
          cout << b[i] << " ";
        }
      } else {
        for (long long int i = 0; i < n; i++) {
          cout << a[i] << " ";
        }
      }
      cout << "\n";
    }
  }
}
