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