#include <bits/stdc++.h>
using namespace std;
int main() {
  int tt;
  cin >> tt;
  while (tt--) {
    int n;
    cin >> n;
    int all = 0;
    vector<int> v(n);
    for (int i = 0; i < n; ++i) {
      cin >> v[i];
      all += v[i];
    }
    if (all <= 0) {
      sort(v.begin(), v.end());
    } else {
      sort(v.begin(), v.end(), greater<int>());
    }
    int sum = 0;
    int i;
    for (i = 0; i < n; ++i) {
      sum += v[i];
      if (sum == 0) break;
    }
    if (i < n)
      cout << "NO" << endl;
    else {
      cout << "YES" << endl;
      for (int i = 0; i < n; ++i) {
        cout << v[i] << ' ';
      }
      cout << endl;
    }
  }
}
