#include <bits/stdc++.h>
using namespace std;
const int mod = 1000 * 1000 * 1000 + 7;
const int INF = 1000 * 1000 * 1000;
const long long LINF = (long long)INF * INF;
int a[60];
int32_t main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    for (int i = (0); i < (n); i++) {
      cin >> a[i];
    }
    int ps = 0, ns = 0, cnt0 = 0;
    vector<int> pos, neg;
    for (int i = (0); i < (n); i++) {
      if (a[i] == 0) {
        cnt0++;
      } else if (a[i] > 0) {
        ps += a[i];
        pos.push_back(a[i]);
      } else {
        neg.push_back(a[i]);
        ns += -a[i];
      }
    }
    if (ps == ns) {
      cout << "NO\n";
      continue;
    }
    cout << "YES\n";
    vector<int> ans;
    if (ps < ns) {
      for (int u : pos) {
        neg.push_back(u);
      }
      ans = neg;
    } else {
      for (int u : neg) {
        pos.push_back(u);
      }
      ans = pos;
    }
    for (int i = (0); i < (cnt0); i++) {
      ans.push_back(0);
    }
    for (int u : ans) {
      cout << u << ' ';
    }
    cout << '\n';
  }
  return 0;
}
