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