#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tt, qq;
  cin >> tt;
  for (qq = 1; qq <= tt; qq++) {
    int n, x;
    vector<int> a;
    cin >> n;
    int sum = 0, neg = 0, pos = 0;
    for (int i = 0; i < n; i++) {
      cin >> x;
      sum += x;
      if (x >= 0)
        pos += x;
      else {
        neg += -1 * x;
      }
      a.push_back(x);
    }
    if (!sum) {
      cout << "NO" << endl;
      continue;
    }
    sort(a.begin(), a.end(), greater<int>());
    cout << "YES" << endl;
    if (neg < pos) {
      for (int i = 0; i < n; i++) {
        cout << a[i] << " ";
      }
    } else {
      for (int i = n - 1; i >= 0; i--) {
        cout << a[i] << " ";
      }
    }
    cout << endl;
  }
  return 0;
}
