#include <bits/stdc++.h>
using namespace std;
const long long int N = 5e5 + 7;
const long long int mod = 998244353;
void solve1() {
  long long int n, a = 0, b = 0;
  cin >> n;
  long long int ar[n];
  for (long long int i = 0; i < n; i++) {
    cin >> ar[i];
    if (ar[i])
      a += ar[i];
    else
      b += ar[i];
  }
  sort(ar, ar + n);
  if (a > b) reverse(ar, ar + n);
  if (a == b) {
    cout << "NO" << endl;
    return;
  }
  cout << "YES" << endl;
  for (long long int i = 0; i < n; i++) cout << ar[i] << " ";
  cout << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  srand(time(0));
  long long int cghf = 1;
  cin >> cghf;
  while (cghf--) {
    solve1();
  }
}
