#include <bits/stdc++.h>
using namespace std;
int hcf(int a, int b) {
  if (!a)
    return (b);
  else
    return (hcf(b % a, a));
}
int lcm(int a, int b) { return ((a * b) / hcf(a, b)); }
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> a(n);
    for (long long i = 0; i < n; i++) cin >> a[i];
    long long net = accumulate(a.begin(), a.end(), 0LL);
    if (net > 0) {
      sort(a.begin(), a.end());
      reverse(a.begin(), a.end());
      cout << ("YES") << "\n";
      {
        auto kjhg = a;
        for (auto idnphq : kjhg) cout << idnphq << ' ';
        cout << "\n";
      };
      continue;
    }
    if (net == 0) {
      cout << ("NO") << "\n";
      continue;
    }
    if (net < 0) {
      sort(a.begin(), a.end());
      cout << ("YES") << "\n";
      {
        auto kjhg = a;
        for (auto idnphq : kjhg) cout << idnphq << ' ';
        cout << "\n";
      };
      continue;
    }
  }
  return 0;
}
