#include <bits/stdc++.h>
using namespace std;
vector<int> input;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int i, j, k, l, m, n, t;
  cin >> t;
  while (t--) {
    input.clear();
    cin >> n;
    bool possible;
    for (i = 0; i < n; i++) {
      cin >> k;
      input.push_back(k);
    }
    sort(input.begin(), input.end());
    k = 0;
    possible = true;
    for (i = 0; i < n; i++) {
      k += input[i];
      if (k == 0) {
        possible = false;
        break;
      }
    }
    if (possible == true) {
      cout << "YES\n";
      for (i = 0; i < n; i++) cout << input[i] << " ";
      cout << '\n';
      continue;
    }
    sort(input.rbegin(), input.rend());
    k = 0;
    possible = true;
    for (i = 0; i < n; i++) {
      k += input[i];
      if (k == 0) {
        possible = false;
        break;
      }
    }
    if (possible == true) {
      cout << "YES\n";
      for (i = 0; i < n; i++) cout << input[i] << " ";
      cout << '\n';
      continue;
    }
    cout << "NO\n";
  }
}
