#include <bits/stdc++.h>
using namespace std;
namespace IO {
inline long long read() {
  long long o = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    o = o * 10 + c - '0';
    c = getchar();
  }
  return o * f;
}
}  // namespace IO
using namespace IO;
const int N = 1e5 + 7, M = 1e6 + 7, INF = 0x3f3f3f3f, Mod = 1e9 + 7;
int a[N];
int t, n;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    int sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      sum += a[i];
    }
    if (sum == 0) {
      cout << "NO" << endl;
      continue;
    }
    if (sum > 0) {
      sort(a, a + n, greater<int>());
    } else if (sum < 0) {
      sort(a, a + n);
    }
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) cout << a[i] << " ";
    cout << endl;
  }
  return 0;
}
