#include <bits/stdc++.h>
using namespace std;
unsigned int nextPowerOf2(unsigned int n) {
  unsigned count = 0;
  if (n && !(n & (n - 1))) return n;
  while (n != 0) {
    n >>= 1;
    count += 1;
  }
  return count;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> v;
    for (int i = 0; i < n; i++) {
      int x;
      cin >> x;
      v.push_back(x);
    }
    int sum = 0;
    for (auto i : v) sum += i;
    if (sum > 0) {
      sort(v.rbegin(), v.rend());
      cout << "YES" << '\n';
      for (auto i : v) cout << i << " ";
      cout << '\n';
    } else if (sum == 0) {
      cout << "NO" << '\n';
    } else if (sum < 0) {
      sort(v.begin(), v.end());
      cout << "YES" << '\n';
      for (auto i : v) cout << i << " ";
      cout << '\n';
    }
  }
}
