#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) cin >> a[i];
    int sum = 0;
    sum = accumulate(a.begin(), a.end(), sum);
    if (sum == 0) {
      cout << "NO" << endl;
      continue;
    }
    if (sum > 0)
      sort(a.rbegin(), a.rend());
    else
      sort(a.begin(), a.end());
    sum = 0;
    if (a[0] == 0) swap(a[0], a[n - 1]);
    cout << "YES" << endl;
    for (int i = 0; i < n; ++i) {
      cout << a[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
