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