#include <bits/stdc++.h>
using namespace std;
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
int offset[] = {1, 0, -1, 0, 1};
const int MXN = 1e6 + 10;
vector<vector<long long int> > pos(MXN);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    vector<long long int> v(n);
    for (long long int i = 0; i < n; i++) cin >> v[i];
    map<long long int, long long int> cnt;
    long long int sum = 0;
    for (long long int i = 0; i < n; i++) {
      sum += v[i];
      cnt[v[i]]++;
    }
    if (sum == 0)
      cout << "NO\n";
    else {
      cout << "YES\n";
      if (sum > 0) {
        for (auto itr = cnt.rbegin(); itr != cnt.rend(); itr++) {
          for (long long int i = 0; i < itr->second; i++)
            cout << itr->first << " ";
        }
      } else {
        for (auto itr = cnt.begin(); itr != cnt.end(); itr++) {
          for (long long int i = 0; i < itr->second; i++)
            cout << itr->first << " ";
        }
      }
      cout << "\n";
    }
  }
  return 0;
}
