#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, s = 0;
  cin >> n;
  vector<long long int> data(n);
  for (long long int i = 0; i < n; i++) {
    cin >> data[i];
    s += data[i];
  }
  if (s == 0)
    cout << "NO"
         << "\n";
  else {
    cout << "YES"
         << "\n";
    sort(data.begin(), data.end());
    if (s < 0) {
      for (long long int i = 0; i < n; i++) cout << data[i] << ' ';
      cout << "\n";
    } else {
      reverse(data.begin(), data.end());
      for (long long int i = 0; i < n; i++) cout << data[i] << ' ';
      cout << "\n";
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int T = 1;
  cin >> T;
  while (T--) solve();
  return 0;
}
