#include <bits/stdc++.h>
using namespace std;
void solve(int cases) {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int su = 0;
  for (int i = 0; i < n; i++) su += a[i];
  sort(a, a + n);
  if (su == 0) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  if (su > 0) {
    for (int i = 0; i < n; i++) cout << a[n - 1 - i] << " ";
    cout << "\n";
    return;
  }
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  cout << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int cases = 1;
  int t = 1;
  cin >> t;
  while (t--) {
    solve(cases++);
  }
}
