#include <bits/stdc++.h>
using namespace std;
long long dx[] = {0, 0, -1, 1};
long long dy[] = {1, -1, 0, 0};
const long long MOD = 1e9 + 7;
const long long N = 1e5 + 10;
const long long inf = 1e18;
void solve() {
  long long n, i;
  cin >> n;
  vector<long long> a(n);
  long long sn = 0, sp = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > 0) sp += a[i];
    if (a[i] < 0) sn += a[i];
  }
  if (sp + sn == 0) {
    cout << "NO"
         << "\n";
    return;
  }
  if (sp + sn > 0) {
    sort(a.begin(), a.end(), greater<long long>());
  } else
    sort(a.begin(), a.end());
  cout << "YES"
       << "\n";
  for (i = 0; i < n; i++) cout << a[i] << " ";
  cout << "\n";
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
