#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long ar[n];
    for (long long i = 0; i < n; i++) cin >> ar[i];
    ;
    long long sp = 0, sn = 0;
    for (long long i = 0; i < n; i++)
      if (ar[i] >= 0)
        sp += ar[i];
      else
        sn += (-1 * ar[i]);
    if (sp == sn)
      cout << "NO\n";
    else {
      cout << "YES\n";
      if (sn > sp) {
        for (long long i = 0; i < n; i++)
          if (ar[i] < 0) cout << ar[i] << " ";
        for (long long i = 0; i < n; i++)
          if (ar[i] >= 0) cout << ar[i] << " ";
      } else {
        for (long long i = 0; i < n; i++)
          if (ar[i] > 0) cout << ar[i] << " ";
        for (long long i = 0; i < n; i++)
          if (ar[i] <= 0) cout << ar[i] << " ";
      }
      cout << "\n";
    }
  }
  return 0;
}
