#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(n);
    int count = 0, m = INT_MAX, ma = INT_MAX;
    int sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] < 0) m = min(m, a[i]);
      if (a[i] > 0) ma = min(ma, a[i]);
      sum += a[i];
    }
    int sum1 = 0;
    if (sum < 0)
      sort(a.begin(), a.end());
    else
      sort(a.begin(), a.end(), greater<int>());
    if (sum != 0) {
      cout << "YES" << endl;
      for (int i = 0; i < n; i++) {
        sum += a[i];
        if (sum == 0) swap(a[i], a[i + 1]);
        cout << a[i] << " ";
      }
    } else
      cout << "NO";
    cout << "\n";
  }
}
