#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, sum = 0;
    bool flag = false;
    cin >> n;
    long long a[n];
    for (long long i = 0; i < n; i++) cin >> a[i], sum += a[i];
    if (sum == 0)
      cout << "NO";
    else {
      sum = 0;
      sort(a, a + n);
      for (long long i = 0; i < n; i++) {
        sum += a[i];
        if (sum == 0) {
          flag = true;
          break;
        }
      }
      if (flag) sort(a, a + n, greater<long long>());
      cout << "YES"
           << "\n";
      ;
      for (long long i = 0; i < n; i++) cout << a[i] << " ";
    }
    cout << "\n";
    ;
  }
  return 0;
}
