#include <bits/stdc++.h>
using namespace std;
bool com(long long a, long long b) { return a > b; }
int main() {
  {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  }
  long long t;
  cin >> t;
  while (t--) {
    long long n, sum1 = 0, sum2 = 0, sum;
    cin >> n;
    long long a[n];
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] < 0)
        sum1 += a[i];
      else
        sum2 += a[i];
    }
    sum = accumulate(a, a + n, 0);
    if (sum == 0)
      cout << "NO"
           << "\n";
    else {
      cout << "YES"
           << "\n";
      if (abs(sum1) > sum2)
        sort(a, a + n);
      else
        sort(a, a + n, com);
      for (long long i = 0; i < n; i++) cout << a[i] << ' ';
      cout << "\n";
    }
  }
}
