#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<long long> ar(n);
  for (long long i = 0; i < n; i++) cin >> ar[i];
  sort(ar.begin(), ar.end());
  long long sum = 0;
  long long f = 1;
  for (long long i = 0; i < n; i++) {
    sum += ar[i];
    if (sum == 0) {
      f = 0;
      break;
    }
  }
  if (f) {
    cout << "YES"
         << "\n";
    for (long long i = 0; i < n; i++) cout << ar[i] << ' ';
    cout << "\n";
  } else {
    sum = 0;
    f = 1;
    sort(ar.begin(), ar.end(), greater<long long>());
    for (long long i = 0; i < n; i++) {
      sum += ar[i];
      if (sum == 0) {
        f = 0;
        break;
      }
    }
    if (f) {
      cout << "YES"
           << "\n";
      for (long long i = 0; i < n; i++) cout << ar[i] << ' ';
      cout << "\n";
    } else
      cout << "NO "
           << "\n";
  }
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) solve();
}
