#include <bits/stdc++.h>
using namespace std;
int main() {
  int tt;
  cin >> tt;
  while (tt--) {
    int n;
    cin >> n;
    int a[n];
    long long int sum = 0;
    long long int k = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (sum > 0)
        sum += a[i];
      else
        k += a[i];
    }
    if (sum + k == 0) {
      cout << "NO" << endl;
    } else {
      if (sum > -k)
        sort(a, a + n, greater<int>());
      else
        sort(a, a + n);
      cout << "YES" << endl;
      for (int i = 0; i < n; i++) {
        cout << a[i] << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
