#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (auto& i : a) cin >> i;
    int s = 0;
    for (auto& i : a) s += i;
    if (!s)
      cout << "NO\n";
    else {
      cout << "YES\n";
      if (s > 0)
        sort(a.begin(), a.end(), greater<int>());
      else
        sort(a.begin(), a.end());
      for (auto& i : a) cout << i << " ";
      cout << "\n";
    }
  }
}
