#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  int psum = 0, msum = 0;
  int zero = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > 0) psum += a[i];
    if (a[i] < 0) msum += a[i];
  }
  if (psum > abs(msum)) {
    puts("YES");
    sort(a.begin(), a.end(), greater<int>());
    for (int i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
    cout << "\n";
  } else if (psum < abs(msum)) {
    puts("YES");
    sort(a.begin(), a.end());
    for (int i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
    cout << "\n";
  } else
    puts("NO");
}
int main() {
  int tc;
  cin >> tc;
  while (tc--) solve();
  return 0;
}
