#include <bits/stdc++.h>
using namespace std;
using namespace chrono;
void solve() {
  long long n;
  cin >> n;
  long long array[n];
  for (int i = 0; i < n; i++) cin >> array[i];
  ;
  long long sum = 0;
  for (int i = 0; i < n; ++i) {
    sum += array[i];
  }
  if (sum == 0) {
    cout << "NO" << endl;
    return;
  }
  if (sum < 0) {
    cout << "YES" << endl;
    sort(array, array + n);
  } else {
    cout << "YES" << endl;
    sort(array, array + n, greater<long long>());
  }
  for (int i = 0; i < n; ++i) {
    cout << array[i] << " ";
  }
  cout << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
