#include <bits/stdc++.h>
using namespace std;
int main() {
  int test;
  cin >> test;
  while (test--) {
    int n, cnt = 0, sum1 = 0;
    cin >> n;
    int a[n];
    for (long long i = 0; i < n; i++) cin >> a[i];
    int sum = 0;
    vector<int> v;
    for (long long i = 0; i < n; i++) {
      sum += a[i];
    }
    if (sum == 0)
      cout << "NO"
           << "\n";
    else if (sum > 0) {
      sort(a, a + n, greater<int>());
      for (long long i = 0; i < n; i++) {
        if (a[i] != 0)
          v.push_back(a[i]);
        else if (a[i] == 0)
          cnt++;
      }
      for (long long i = 0; i < cnt; i++) v.push_back(0);
      cout << "YES"
           << "\n";
      for (long long i = 0; i < n; i++) cout << v[i] << " ";
      cout << "\n";
    } else if (sum < 0) {
      sort(a, a + n);
      for (long long i = 0; i < n; i++) {
        if (a[i] != 0)
          v.push_back(a[i]);
        else if (a[i] == 0)
          cnt++;
      }
      for (long long i = 0; i < cnt; i++) v.push_back(0);
      cout << "YES"
           << "\n";
      for (long long i = 0; i < n; i++) cout << v[i] << " ";
      cout << "\n";
    }
  }
}
