#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
vector<int> mods = {1000000007, 1000000009, 998244353};
const double pi = acos(-1.0);
const int inf = 0x3f3f3f3f;
const int maxn = 200005;
void task() {
  int n;
  cin >> n;
  vector<int> a(n, 0), b(n, 0);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sort((a).begin(), (a).end());
  if (sum == 0)
    cout << "NO"
         << "\n";
  else {
    cout << "YES"
         << "\n";
    if (sum > 0) {
      for (int i = (n - 1); i >= (0); --i) cout << a[i] << ' ';
      cout << "\n";
    } else {
      for (int i = 0; i < n; i++) cout << a[i] << ' ';
      cout << "\n";
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int T = 1;
  cin >> T;
  for (int __ = 1; __ <= T; __++) {
    task();
  }
  return 0;
}
