#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, sum = 0;
    cin >> n;
    int z[n];
    for (int i = 0; i < n; i++) {
      cin >> z[i];
      sum += z[i];
    }
    if (sum == 0)
      cout << "NO" << endl;
    else {
      sort(z, z + n);
      cout << "YES" << endl;
      if (sum < 0) {
        for (int i = 0; i < n; i++) cout << z[i] << " ";
        cout << endl;
      } else {
        for (int i = n - 1; i >= 0; i--) cout << z[i] << " ";
        cout << endl;
      }
    }
  }
}
