#include <bits/stdc++.h>
using namespace std;
ifstream iredirect;
ofstream oredirect;
const string file = "data";
const long long INF = 9223372036854775807ll;
const long long dx[] = {1, -1, 0, 0, 1, 1, -1, -1},
                dy[] = {0, 0, 1, -1, 1, -1, 1, -1}, inf = 2147483647;
void prepare_IO() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> v(n);
  long long sum = 0, sumpos = 0, sumneg = 0;
  for (long long i = 0; i < n; ++i) {
    cin >> v[i];
    if (v[i] >= 0)
      sumpos += v[i];
    else
      sumneg -= v[i];
    sum += v[i];
  }
  if (sum == 0) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  sort(v.begin(), v.end());
  if (sumpos > sumneg) reverse(v.begin(), v.end());
  for (auto x : v) cout << x << " ";
  cout << "\n";
}
signed main() {
  prepare_IO();
  long long number_of_tests = 1;
  cin >> number_of_tests;
  for (long long testcase = 1; testcase <= number_of_tests; ++testcase) solve();
  return 0;
}
