#include <bits/stdc++.h>
using namespace std;
int K;
vector<int> ans;
bool cmp(int a, int b) { return a >= b; }
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    vector<int> v;
    int f = 0, flg = 0;
    sort(a, a + n);
    int s[n];
    s[0] = a[0];
    for (int i = 1; i < n; i++) {
      s[i] = s[i - 1] + a[i];
      if (s[i] == 0) f = 1;
    }
    if (s[0] != 0 && f == 0) {
      cout << "Yes" << '\n';
      for (int i = 0; i < n; i++) cout << a[i] << " ";
      cout << '\n';
      continue;
    }
    sort(a, a + n, greater<int>());
    s[0] = a[0];
    f = 0;
    for (int i = 1; i < n; i++) {
      s[i] = s[i - 1] + a[i];
      if (s[i] == 0) f = 1;
    }
    if (s[0] != 0 && f == 0) {
      cout << "Yes" << '\n';
      for (int i = 0; i < n; i++) cout << a[i] << " ";
      cout << '\n';
      continue;
    }
    cout << "No" << '\n';
  }
  return 0;
}
