#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
void read(vector<T> &a);
template <class T>
void read(T &a) {
  cin >> a;
}
template <class A, class... B>
void read(A &a, B &...b) {
  read(a);
  read(b...);
}
template <class T>
void read(vector<T> &a) {
  for (auto &v : a) read(v);
}
void Debug() { cerr << "]" << endl; }
template <class H, class... T>
void Debug(H h, T... t) {
  cerr << h;
  if (sizeof...(t)) cerr << ", ";
  Debug(t...);
}
const int d4x[4] = {-1, 0, 1, 0};
const int d4y[4] = {0, 1, 0, -1};
const int MOD = 998244353;
const ll INF = 1e18 + 7;
const int MAXN = 3e5 + 100;
void test_case() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &x : a) cin >> x;
  int pos = 0, neg = 0;
  for (int i = 0; i < n; ++i) {
    if (a[i] >= 0)
      pos += a[i];
    else
      neg += a[i];
  }
  if (pos + neg == 0) {
    cout << "NO\n";
    return;
  } else {
    cout << "YES\n";
    vector<int> npos, nneg;
    for (int i = 0; i < n; ++i) {
      if (a[i] >= 0)
        npos.push_back(a[i]);
      else
        nneg.push_back(a[i]);
    }
    if (pos + neg > 0) {
      sort(npos.rbegin(), npos.rend());
      for (auto x : npos) cout << x << ' ';
      for (auto x : nneg) cout << x << ' ';
    } else {
      sort(nneg.begin(), nneg.end());
      for (auto x : nneg) cout << x << ' ';
      for (auto x : npos) cout << x << ' ';
    }
    cout << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int tt;
  cin >> tt;
  while (tt--) {
    test_case();
  }
  return 0;
}
