#include <bits/stdc++.h>
using namespace std;
bool helper(int arr[], int n) {
  int sum = arr[0];
  if (sum == 0) {
    return false;
  } else {
    for (int i = 1; i <= (int)(n - 1); ++i) {
      sum += arr[i];
      if (sum == 0) {
        return false;
      }
    }
  }
  return true;
}
int main() {
  int t;
  cin >> t;
  while (t > 0) {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < (int)(n); ++i) cin >> a[i];
    if (accumulate(a, a + n, 0) > 0) {
      sort(a, a + n, greater<int>());
    } else {
      sort(a, a + n);
    }
    if (helper(a, n) == false) {
      cout << "NO"
           << "\n";
    } else {
      cout << "YES"
           << "\n";
      for (int j = 0; j < (int)(n); ++j) {
        cout << a[j] << " ";
      }
      cout << "\n";
    }
    t--;
  }
  return 0;
}
