#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, s = 0;
    cin >> n;
    vector<long long int> v(n);
    for (long long int i = 0; i < n; i++) {
      cin >> v[i];
      s += v[i];
    }
    if (s == 0)
      cout << "NO\n";
    else if (s > 0) {
      cout << "YES\n";
      sort(v.begin(), v.end(), greater<long long int>());
      for (long long int i = 0; i < n; i++) cout << v[i] << " ";
      cout << endl;
    } else {
      cout << "YES\n";
      sort(v.begin(), v.end());
      for (long long int i = 0; i < n; i++) cout << v[i] << " ";
      cout << endl;
    }
  }
  return 0;
}
